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
0 answers
Uncaught TypeError: Cannot read property 'dispose' of undefined
I'm using all the latest versions of create-react-app, react, webpack, amcharts. I've implemented a amchart component with webpack, published that to our local npm registry and tried to import it in the create-react app. When I'm using the amchart…

Venu Pantangi
- 31
- 2
3
votes
1 answer
In create-react-app, does the development build 'npm start' get output to the filesystem?
I have a create-react-app. It works great, however, where does the output to npm start get served from, i.e, what is the path on disk? Or does it get served from memory?
I would like to serve that output from IIS to avoid some cross-origins issues…

Matt
- 25,943
- 66
- 198
- 303
3
votes
2 answers
Firebase `is not a function` Error with firebase 5.11.1 and greater
With these in my package.json
"firebase": "^5.11.1",
"react-scripts": "3.0.1",
and then running react-scripts start
with this index.js
import firebase from 'firebase/app';
import 'firebase/functions';
const config = {
apiKey: "XXXXX-XXXXXXX",
…

StefanHayden
- 3,569
- 1
- 31
- 38
3
votes
2 answers
Create React App with TypeScript TS2322 error with Context API + useState hook?
I have a super simple React Typescript project using the Context API to pass down a useState hook.
export const AppContext = React.createContext(null);
function App() {
const [value, setValue] = React.useState(3);
return (
…

Evanss
- 23,390
- 94
- 282
- 505
3
votes
0 answers
HapiJS + create-react-app + webpack-dev-middleware configuration
I am currently using a create-react-app with HapiJS as a proxy for serving the static files.
This is how my current setup looks like:
//server.js
const server = new Hapi.Server({
port: process.env.PORT || 80,
routes: {
…

PsyGik
- 3,535
- 1
- 27
- 44
3
votes
1 answer
create react app - access "On your network" doesn't work
I'm using create-react-app project. I try to test my localhost:3000 app on my iphone.
When I start an app yarn start I get this message:
Compiled successfully!
You can now view front-client in the browser.
Local: http://localhost:3000/ …

Tomasz Mularczyk
- 34,501
- 19
- 112
- 166
3
votes
0 answers
mdx.macro: Path must be a string. Received undefined
I basically want to do this:
importMDX(`../${variable}.mdx`);
But the only thing that works is this:
importMDX('../filename.mdx');
Is using variables in the importMDX() function not supported at all or am i missing something?…

Ferben
- 31
- 3
3
votes
0 answers
CRA window.location.reload(true) not updating PWA
I'm using Create-react-app and I registered the serviceWorker that comes with.
import * as serviceWorker from "./serviceWorker"
class App extends Component {
constructor(props) {
super(props)
serviceWorker.register({
onUpdate:…

Benny
- 677
- 1
- 6
- 22
3
votes
1 answer
Getting react-datepicker to appear correctly when using react-testing-library
I've been trying to figure out how to get react-testing-library working with react-datepicker.
So far, I've been able to get the input box wrapped correctly, and can access it via the getByLabelText function, but I can't seem to get the date picker…

Shafiq Jetha
- 1,337
- 16
- 30
3
votes
1 answer
Why does localhost server start when running React?
create-react-app seems to start localhost server at npm start.
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
Then open http://localhost:3000/ to see your app.
When you’re ready to deploy to production, create a…
user11584620
3
votes
2 answers
Issue on Product version of Styled-Components when render with Rendertron
have very simple sample app which build Create React App + Styled-Components to prove this issue. But I have real big application which I am facing this issue which I am going to explain it below.
I would like to pre-render this app with…

AJ-
- 1,027
- 2
- 13
- 24
3
votes
1 answer
Build Fails With Spread Operator on Travis CI Only
my build, npm run build, for my website works locally, but on Travis CI it fails with the following error:
> node scripts/build.js
/home/travis/build/PatrickDuncan/patrickduncan.github.io/node_modules/@hapi/hoek/lib/deep-equal.js:39
options = {…

Patrick Duncan
- 340
- 2
- 9
3
votes
3 answers
How to add newline when I return array in React?
I needed to print a string, "dummy data".
So I made a function that returns array which has string "dummy data" in it.
I was able to print "dummy data dummy data dummy data ...". However, I want to put newline each string. Then it will looks…

Mason YM Koh
- 324
- 2
- 10
3
votes
0 answers
Publish existing create-react-app using nwb
I have an existing React application built with create-react-app version 2. I understand that I'll either have to eject it or use a tool like nwb to publish it to npm.
Can I use npm on an existing project? From reading the docs it seems I have to…

dorriz
- 1,927
- 3
- 12
- 19
3
votes
3 answers
How to create React.js app without a function in App.js
I just finish typing npx create react app to create a react app but for some reason my App.js is a function not a class
eg)
result:
function App() {
return ()
I want something like:
Class app extends components{
render (return())
}
I could…

고민영
- 41
- 2
- 5