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
4 answers

Is there a way to submit a reactjs PWA on Google Play?

I want to use the "Write once, run everywhere" So I created a PWA in reactjs with create-react-app. My app works greatly, and I can put it on the home screen of my mobile from the website. However, I want to be visible on mobile stores too (starting…
3
votes
1 answer

Docker build for React App failing in Gitlab CI runner

I have been trying to create a react app Gitlab CI but it keeps failing on the RUN npm run build (tried RUN CI=true npm run build too) when trying to create a docker file. Here's my Dockerfile FROM node:8.11.1 # Create app directory WORKDIR…
Karan Gujral
  • 389
  • 2
  • 4
  • 21
3
votes
1 answer

Using babel-preset-react-app with @babel/register

I'm trying SSR with create-react-app without ejecting. In this repository, using react-app presets with changes like below fails. diff --git a/server/index.js b/server/index.js index 9b0deea..b5e5d5f 100644 --- a/server/index.js +++…
yskkin
  • 854
  • 7
  • 24
3
votes
1 answer

Typescript compiler -disable or remove

I have a Create React App project and I'm using Yarn with React Scripts. In this is a small Typescript component, that I just compile when I'm working on it. This has been fine for a year now with no problems. Recently I upgraded VSCode and now…
beek
  • 3,522
  • 8
  • 33
  • 86
3
votes
2 answers

React app throwing errors when using 'react-pdf'

I've been having trouble getting react-pdf to work properly in my react app that I created using 'create-react-app'. From various github comments on the react-pdf page, it seems that there's an issue setting up the workerSrc in React applications…
cle_joe
  • 101
  • 1
  • 10
3
votes
3 answers

Chrome, Firefox debuggers not displaying the correct value for 'this' in a react app

Here's a bit of code, within a react component class (scaffolded using CRA 2) click = () => { console.log(this, "hello"); let x = 1 + 1; //This is just here to let chrome put a break point here. } When this code runs, it will print…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
3
votes
3 answers

multiple entry points by using create-react-app

I have a page with 20% of React components and 80% of normal html content. It is necessary to place several react components at different points of the page, and therefore I need several entry points in index.html. I want to use create-react-app,…
3
votes
0 answers

display a favicon in the head tag using electron

i have tried to add an Image inside the head Tag under /public like this . mytitle
Tun
  • 53
  • 6
3
votes
1 answer

Where does create-react-app application store it's babel configuration when not ejected?

I want to read from JS the babel configuration within a module I am doing. I do not use webpack, I only use babel with babel cli. Where can I find the babel configuration of a non ejected application made with create-react-app ?
Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204
3
votes
3 answers

Problem serving static files with express

i have read some several articles about how to serve static files from create-react-app with express. I have tried everything now. Can someone please help me? This is how my structure looks like When i deploy this to Heroku i get following error:…
user9883549
3
votes
1 answer

Create React App production build succeeds but produces code with errors

I have a create-react-app React application I've been developing using the webpack-dev-server, and everything works there in development. However, when I build for production, the output build does not work and has the following console…
chrispytoes
  • 1,714
  • 1
  • 20
  • 53
3
votes
3 answers

How can we pass environment or config variables during run time in a cra(createreactapp)

How can we pass environment or config variables during run time in a cra(createreactapp). I do not want to build for different env but use one build with different configs in different env
3
votes
1 answer

'react-i18next: withNamespaces is not a function' when testing

I'm using react-i18next on a typescript project. I was using translate() HOC but it's deprecated so I've migrate to withNamespaces(). Everything used to work pretty well. Now everything keeps working fine when I start the app, but it fails badly…
Tdy
  • 863
  • 12
  • 28
3
votes
1 answer

Webpack doesn't recognize jsx code at node modules

I started a new project with the latest version of create-react-app. I'm trying to consume a private NPM library. This library ships the code and it's the responsibility of the app importing the packages to transpile the components from it. I…
victor.ja
  • 811
  • 1
  • 7
  • 27
3
votes
0 answers

create-react-app my-app --scripts-version=react-scripts-ts gets Jest 20.0

When I start a brand-new CRA typescript project, I seem to get stuck with an ancient version of Jest: create-react-app my-app --scripts-version=react-scripts-ts cd my-app yarn test -v v20.0.4 ... but the same thing for a javascript project (e.g.…
Eric
  • 935
  • 1
  • 8
  • 23