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

React loadable unable to load component on every new build unless refresh the page

I've been facing this issue since a while, when ever I create new build in production I got load error unless I refresh the page. The service worker is getting updated fine but don't know whats going on. I've been using the following…
Moeen Basra
  • 733
  • 4
  • 18
3
votes
1 answer

React Components using css files that are not imported to them

Basically, I am using different css files for a reason. My problem is that when I am styling something in one css file, it affects some other components I have, not only the one where I import this css file. I think the problem is with react-router.…
Isard
  • 312
  • 1
  • 14
3
votes
1 answer

create react app default port env

I'm trying to change the default port being used by create react app. If I use "start": "PORT=4000 react-scripts start" and restart the server, it works fine. But using "start": "process.env.REACT_APP_PORT react-scripts start" returns undefined. My…
3
votes
2 answers

NODE_ENV in webpack react app is not being set corretly

I'm building a simple react app that I'm deploying to S3. I used's facebook's create-react-app as a starting point. I want to add a conditional in my index.html so that I'm only including Google Analytics in production. To test that it's working I…
3
votes
1 answer

add third-party js library to Create React App

I am using chartIQ library in my Create React App. I added it just by using script tag in my index.html file and it works that way, but it does not feel right. Because I need this library only for one…
Anna
  • 2,911
  • 6
  • 29
  • 42
3
votes
0 answers

Create react app App fails when importing custom library

I created a brand new app using creat-react-app. got it running. My company has a custom library of components in an npm repository. I pull that in, and import one of the components. I get a failure immediately. The error I'm getting…
3
votes
2 answers

running frontend and backend on different ports

Hi Im running my frontend (create-react-app) and backend server (express.js) on different ports but on the same host. For example: frontend is on 127.0.0.1:3000 and backend on 127.0.0.1:3003. in my package.json: {... "proxy":…
Morten
  • 133
  • 4
  • 15
3
votes
1 answer

Any benefit to spriting images in Create React App?

I have multiple background images used in my CSS. Best practice for this used to be to combine images into a single sprite sheet to reduce the number of HTTP requests. From looking at the Create React App documentation there is no mention of…
Evanss
  • 23,390
  • 94
  • 282
  • 505
3
votes
1 answer

Create-react-app cannot build. it takes long time and then got error

I have create-react-project v15 and run npm run build and takes long time (20mins)(like freezing) for running build then got this error result. How to Fix this? enter code…
riseres
  • 3,004
  • 4
  • 28
  • 40
3
votes
2 answers

React - How to import/source local images into an Object

I am using this library for a photo gallery on a create-react-app project. Loading the images as http works fine ie: const IMAGES = [{ src: "https://c2.staticflickr.com/someimage.jpg" .... }]; How can I source…
Null isTrue
  • 1,882
  • 6
  • 26
  • 46
3
votes
2 answers

How to include JavaScript libraries only in production build files of create-react-app?

I'm trying to add a JavaScript library that is only included in the production build files generated by create-react-app. What's the best way to do this? Specifically, I'm trying to include the Rollbar.js client-side error monitoring library. I…
MattSidor
  • 2,599
  • 4
  • 21
  • 32
3
votes
1 answer

How to connect webpack dev server to express?

I'm running BOTH an express and create-react-app app. They are seperate entities during development and express is just an endpoint which we communicate through 'proxy' field in package.json proxy: 'http://localhost:5000. During production, I run…
Hyrule
  • 635
  • 2
  • 10
  • 23
3
votes
1 answer

create-react-app importing modules as ES6 Modules when project is using CommonJS Modules

I am trying to use CommonJS module format, with create-react-app (CRA). The documentation for CRA says: ..Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is…
Mike S
  • 166
  • 3
  • 10
3
votes
1 answer

create-react-app and url base path for the development server

during development, I'd like to use an already existing test server, this server uses apache, so I basically used mod_proxy to proxy it to a subdirectory of my server, let's say http://myserver/myreactapp/ Problem is, I didnt find a way to tell the…
beauchette
  • 1,046
  • 2
  • 13
  • 31
3
votes
2 answers

use pagination with react-bootstrap table

I am building a basic react app using create-react-app and react-bootstrap. I am using a table to show information using from react-bootstrap https://react-bootstrap.github.io/components/table/. I am trying to get pagination working for the table…
oneMoreDeveloper
  • 111
  • 4
  • 11
1 2 3
99
100