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.
Questions tagged [create-react-app]
5893 questions
3
votes
1 answer
How to build create-react-app so client can't see code in an organized way
I'm using create react-app and noticed that with my builds the client can see my exact code as I see it when I'm editing. I would like to prevent this to (at least a little bit) deter clients from easily cheating in my game. If they can see how…

PurplePanda
- 629
- 9
- 29
3
votes
2 answers
Why are my npm_modules folders all highlighted red in VS Code?
I recently cloned a React repository (based off of create-react-app) from BitBucket. Why are all my node_modules folders highlighted red in Visual Studio Code?
I ran npm install, npm update, and npm start and didn't run into any errors, but the…

StephenGodderidge
- 176
- 2
- 14
3
votes
3 answers
Bootstrap is not working in create-react-app
I am trying to use this nav bar while it seems classes are not working:
I did all the steps like it was described in the documentation.
I've imported it in the index.js:
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
import React…
user8978302
3
votes
2 answers
How to tell react-create-app build script to not minimize parts of file?
TL;DR: How can I tell react build script to leave parts of code untouched?
I made an app with "create-react-app". I am using the standard "npm run build" command to make my production build.
In the index.html file I included a Google Tag Manager…

sborn
- 111
- 1
- 9
3
votes
1 answer
Importing CSS from node_modules into a Create React App
I've found loads of questions on this, but none of the answers are working..
I'm trying to import a font from node modules from this package into a Create React app
I've managed to get it compile with
@import…

beek
- 3,522
- 8
- 33
- 86
3
votes
0 answers
Docker + React-Scripts: Slow Bundle.js Download
In a small create-react-app project, I'm experiencing pretty abysmal download times for our bundle.js file when running through Docker.
When react-scripts start is run locally I'm seeing 1.4 seconds for a freshly compiled bundle download:
When…

Gowiem
- 1,297
- 17
- 19
3
votes
1 answer
Service worker with create react app js chunks was loaded wrongly
I am using Create react app and service worker. However, sometimes when I build a new version, some js chunks was still loaded from service worker which they are not supposed to? And instead of loading a js file, it actually loads a html. After…

Bruce Mu
- 893
- 11
- 22
3
votes
1 answer
How to use create-react-app build with custom enviroment variables?
I have some custom enviroment variables for example:
REACT_APP_API_URL='http://localhost:6000/api'
... and different enviroments (develop, test, uat and production).
How can I define custom variables and custom build command for each enviroment?
I…

froston
- 1,027
- 1
- 12
- 24
3
votes
0 answers
Spring boot corrupting fonts
I have an app built on Spring-Boot (1.5.10.RELEASE) and create-react-app. Everything working fine in development (ie running spring-boot via IDE and using yarn start to run the web app.)
Problem is when running the production package. Using embedded…

Pram
- 2,261
- 3
- 31
- 50
3
votes
2 answers
Storybook with react-scripts@next and css modules
I tried react-scripts@next 2.0.0-next.66cc7a90 (create-react-app v2) because support for css modules has been added. Unfortunately, css modules are ignored by storybook. Any quick fix I could do?

wiesson
- 6,544
- 5
- 40
- 68
3
votes
1 answer
importing sass variables from jsx file
I'm working on a React project built with create-react-app. I have a file called common.scss where I keep a list of variables, for example:
$blue: 'blue';
$red: 'red';
The SCSS files are pre-processed with node-sass-chokidar.
I would like to be…

Mister_L
- 2,469
- 6
- 30
- 64
3
votes
2 answers
Viewing NodeJS projects on other devices in the network
I’m trying to view a CreateReactApp project from a different device. I tried setting the host to 0.0.0.0 by setting the “start” script to:
"start": "cross-env HOST=0.0.0.0 react-scripts start".
Though the console did log
Attempting to bind to HOST…

Ben Carp
- 24,214
- 9
- 60
- 72
3
votes
2 answers
Access MaterialUI breakpoints inside css
Within a create-react-app project I'm using material-ui 1.x and creating a custom theme with custom breakpoints, as such..
import { createMuiTheme } from '@material-ui/core/styles';
let customTheme = createMuiTheme({
breakpoints:{
values:{
…

honkskillet
- 3,007
- 6
- 31
- 47
3
votes
1 answer
Use npm modules written in ES6 with react-scripts
In my project I need to use the npm module ipfs-api with create-react-app.
I can run npm start and run the proect.
But when I try to build the proect with react-scripts build, it throws the following error
Failed to compile.
Failed to minify the…
user8081170
3
votes
1 answer
Invalid package name "node_modules": node_modules is a blacklisted name
I'm having an issue installing npm modules in the client side of my react app. I'm also unable to deploy to Heroku due to this error. Here is the exact error:
`npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "node_modules":…

keggatron
- 81
- 2
- 4