Questions tagged [create-react-app]

create-react-app is a starter-kit for creating React applications with no build configuration. If you’re getting started with React, use this to automate the build of your application. There isn't any configuration file, and react-scripts is the only extra build dependency in your package.json file. Your environment will have everything you need to build a modern React application.

Getting Started

5893 questions
3
votes
0 answers

each create react app takes 200MB+ how to reference modules instead of having a copy in node_modules

Boiler plate project created with create react app is 200MB+, with out us having wrote any code. Most of the 200MB+ files is in the node_modules folder ( from all the lib it's downloaded). I can prevent re-download by installing most of the modules…
JackDev
  • 11,003
  • 12
  • 51
  • 68
3
votes
4 answers

Background image will not fit in the whole page in App.css in create-react-app

I'm not sure why but any image I choose for the page's background is never 100% entirely shown. I'm not sure if create-react-app has something to do with it or what but there is always some part of the image that is overflowing and gets cut from the…
albert_anthony6
  • 594
  • 2
  • 9
  • 30
3
votes
2 answers

npm start and npm run build fail with npm ERR! code ELIFECYCLE

I have had this issue for 3 days now. I used to get this error occasionally and it would just start working after a few troubleshooting commands, now npm start is not working at all and I keep getting this error. Host Details: Ubuntu server 18.04…
boostedd
  • 268
  • 1
  • 3
  • 13
3
votes
1 answer

Cannot get the styles of @ant-design/pro-layout to work with `create-react-app`

I am trying to use @ant-design/pro-layout in a create-react-app typescript project. I cannot get the styles of @ant-design/pro-layout to work. The components load well, but the LESS does not. Is there anything to do in particular other than…
Greg Forel
  • 2,199
  • 6
  • 25
  • 46
3
votes
1 answer

Docker compose not properly copying files to run react app

I am trying to run a create-react-app inside of a docker container and automate docker build/run with docker-compose to eventually add other containers like a backend + db. Running docker-compose in the local folder works properly but setting the…
3
votes
2 answers

React - difference between function and component

I'm just starting to learn React, and I noticed that the App.js component which is initially created differs from the one in the tutorials (which are pretty recent). The one generated looks like this: import React from 'react'; import logo from…
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
3
votes
3 answers

How to fix CORS error with credentials: include?

Another question about CORS, I looked through a lot of information, but couldn't do anything. So I will be grateful for the help. I am sending a fetch request with credentials enabled. What the browser regularly swears on at…
Max
  • 83
  • 1
  • 2
  • 8
3
votes
1 answer

create-react-app now comes with eslint, how are folks running autofix now?

I used to build React apps starting with create-react-app, then I would install eslint with plugins and a custom config, run an eslint init, and add some custom scripts to run eslint and eslint auto fix easily and automatically on certain actions…
jtucker7
  • 41
  • 4
3
votes
3 answers

Unable to create a react app using "create-react-app"

I have installed "create-react-app" globally on my pc using "npm install create-react-app -g". And it worked just fine for months. I had previously created a lot of react app using the "create-react-app app-name" command. And it worked flawlessly.…
Va_M
  • 522
  • 2
  • 5
  • 18
3
votes
1 answer

What is a good alternative to webpack.DefinePlugin for create-react-app?

I'm working on an ejected React application that uses webpack.DefinePlugin to store globally an object defining the folder names in the application for a specific path (kind of an ls in shell but using node fs) I'm researching how to go back to the…
Miluna
  • 309
  • 3
  • 9
3
votes
1 answer

css module localIdentName in create-react-app

Is there a default way to set localIdentName for css modules without ejecting? I couldn't find such an option on the official docs so I decided to ask here if someone by any chance knows a way without ejecting and tempering with the…
Jorayen
  • 1,737
  • 2
  • 21
  • 52
3
votes
1 answer

events.js:180 throw er; // Unhandled 'error' event ^

Error while npm start in Windows 10 After npm install in vscode in my windows machine, I run npm, it starts but it shows the above error. I have cleaned cache but it did not solve. I have searched on google but exception like this is not…
Addy
  • 31
  • 1
3
votes
1 answer

Getting source maps to work for Chrome extensions built using Create React App

I'm writing a Chrome extension using React, and more specifically, using Create React App. If I inspect the popup that the extension generates, look at Sources, and click on any of the js files, Chrome says "Source Map detected". If I click on…
3
votes
4 answers

create-react-app: npm start not working, react-scripts not found

NPM start does not work. Node: v12.6.0 npm: 6.10.0 Note: I put the project directory into the Trash, and ran npm start in there and it worked. Does anyone have any idea why it's working? What I've tried: Used initialization commands as given by…
Work_Work
  • 41
  • 1
  • 1
  • 6
3
votes
1 answer

can't generate project with create-react-app

I am using Linux on windows (WSL). When I try to scaffold a project with create-react-app I get this message: error An unexpected error occurred: "ENOENT: no such file or directory, lstat…
Sandro Palmieri
  • 1,193
  • 2
  • 12
  • 26