create-react-app

Docker container exiting immediately after starting when using npm init react-app

我是研究僧i 提交于 2020-05-14 17:19:55
问题 I am trying to start a Docker container with a react project, the project is created using npm init react-app. This is my docker file # Specify a base image FROM node:alpine WORKDIR /usr/app # Install some depenendencies COPY ./package.json ./ RUN npm install COPY ./ ./ # Default command CMD ["npm", "run", "start"] Docker build . creates an image successfully (with a lot of npm warnings) and then when I run Docker run <image> this is the output in my terminal > mytest@0.1.0 start /usr/app >

Docker container exiting immediately after starting when using npm init react-app

孤人 提交于 2020-05-14 17:19:24
问题 I am trying to start a Docker container with a react project, the project is created using npm init react-app. This is my docker file # Specify a base image FROM node:alpine WORKDIR /usr/app # Install some depenendencies COPY ./package.json ./ RUN npm install COPY ./ ./ # Default command CMD ["npm", "run", "start"] Docker build . creates an image successfully (with a lot of npm warnings) and then when I run Docker run <image> this is the output in my terminal > mytest@0.1.0 start /usr/app >

React Typescript: Line 0: Parsing error: Cannot read property 'name' of undefined

安稳与你 提交于 2020-05-14 16:22:28
问题 Today suddenly I started to get build errors on a project built with Typescript. In a file that (or anything it references) hasn't been changed in weeks, I started to get: ./path/to/my/file.ts Line 0: Parsing error: Cannot read property 'name' of undefined This error first appeared on our CI, could be replicated by manually building on the server, and I could finally reproduce on my own computer (which was running perfectly) after updating all packages. Now, even if I pull the old (building)

How can I list source folder contents in React or create-react-app?

╄→гoц情女王★ 提交于 2020-05-14 09:08:26
问题 I'm writing a React app using create-react-app . Since I can do: import LocalClass from "./localfolder/LocalClass.js" and even (using dynamic import): import('./localfolder/LocalClass.js').then((module) => { /* ... */ }) is there a way to list localfolder contents, so I can dynamically import the contained files? The listing should happen at compile or bundling time, not at runtime (I'm thinking about an automatic menu creation feature). The folder may contain plain classes too (i.e. not

How can I list source folder contents in React or create-react-app?

馋奶兔 提交于 2020-05-14 09:08:07
问题 I'm writing a React app using create-react-app . Since I can do: import LocalClass from "./localfolder/LocalClass.js" and even (using dynamic import): import('./localfolder/LocalClass.js').then((module) => { /* ... */ }) is there a way to list localfolder contents, so I can dynamically import the contained files? The listing should happen at compile or bundling time, not at runtime (I'm thinking about an automatic menu creation feature). The folder may contain plain classes too (i.e. not

create-react-app error import type * as PrettyFormat from './types' in pretty-format

≡放荡痞女 提交于 2020-05-13 05:34:14
问题 it's a fresh install of cra with typescript template running on node 13.11.0 it gives me error when try to run npm start TypeScript error in D:/Projects/personal-site/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts(7,13): '=' expected. TS1005 5 | * LICENSE file in the root directory of this source tree. 6 | */ > 7 | import type * as PrettyFormat from './types'; | ^ 8 | /** 9 | * Returns a presentation string of your `val` object 10 | * @param val any

React Routing works in locally but not Heroku

假如想象 提交于 2020-05-11 07:28:48
问题 My issue here is incredibly similar if not exactly the same as the one outlined in this issue. Unfortunately, I haven't been able to resolve it using the strategy it provides. So here are my own details: I am using Create React App , React Router 4 , Express , and Heroku and have followed the instructions here with regards to setting up a server with CRA. Locally, I am able to access routes such as myapp/about , yet after building and pushing to heroku, these 404. I can navigate to this route

Create react app Error: Cannot find module './locale'

怎甘沉沦 提交于 2020-05-08 02:06:42
问题 I bootstrapped my application with create-react-app and when I run my app it compiles with warnings and it throws errors on the browser. Error while compiling ./node_modules/rc-picker/node_modules/moment/src/lib/locale/locales.js Module not found: Can't resolve './locale' in '/Users/macbook/Desktop/projects/pizza/Yummi-fend/node_modules/rc-picker/node_modules/moment/src/lib/locale' Error on browser Error: Cannot find module './locale' ▶ 2 stack frames were collapsed. __webpack_require__

How can I deploy production npm build of react app to Azure App Service

跟風遠走 提交于 2020-04-30 07:19:05
问题 I'm trying to deploy the npm build version of my react app to azure web service through ftp. I moved the build folder, but when I load my application's URL, the default screen loads with Hey Node Developers! . I can deploy via github and kudu. However, I don't believe that's a production quality application since it's not built using npm run build with create-react-app . I've been through this azure guide, as well as various blogs. I've also included the web.config file. Nothing has gotten my

How can I deploy production npm build of react app to Azure App Service

不羁岁月 提交于 2020-04-30 07:18:27
问题 I'm trying to deploy the npm build version of my react app to azure web service through ftp. I moved the build folder, but when I load my application's URL, the default screen loads with Hey Node Developers! . I can deploy via github and kudu. However, I don't believe that's a production quality application since it's not built using npm run build with create-react-app . I've been through this azure guide, as well as various blogs. I've also included the web.config file. Nothing has gotten my