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
React-scripts: Unable to import module from dist folder
I have a mono-repository containing a library application bundled using Webpack & a demo application to test the library.
When I try to import the library in the demo like this:
import Library from 'library-xxxx'
I get the following error:
Module…

Melchia
- 22,578
- 22
- 103
- 117
3
votes
2 answers
How to add polyfill for String.repeat function for ie11?
How would I add polyfill for String.repeat method for ie11? I am not using it directly in my code, it's probably some of the imported libs.
In IE console I get this error: Object doesn't support property or method 'repeat'
I also get…

icelic
- 113
- 2
- 11
3
votes
2 answers
material-ui: Cannot find module: './AccessAlarm'
We have a project using @material-ui. It's built upon:
create-react-app: 3.4
node: 10.18.1
yarn: 1.21.1
@material-ui: 4.9.x
This problem is weird: i can yarn start and yarn build locally, the versions are exactly the same as server. However, after…

Joy
- 9,430
- 11
- 44
- 95
3
votes
1 answer
Error "Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which has since been addressed"
I recently installed Ubuntu 18.04 Stable version. I installed latest stable version of Node.js (v12.16.1) and npm (v6.13.4).
When i was trying to install "create-react-app" using "npm i create-react-app", I am getting error.
Your cache folder…
user6795343
3
votes
0 answers
Create-React-App ReferenceError: exports is not defined
I have a react app that is created using https://github.com/facebook/create-react-app
but I'd like to import some code that is shared with a NodeJs project (and thus use the commonjs syntax)
The code is exported with
exports.Agreement =…

teone
- 2,153
- 3
- 25
- 49
3
votes
0 answers
Create-React-App/Typescript/Jest - TypeError: Cannot redefine property: __esModule
I'm writing Jest tests for some react components, which are in a Create-React-App project that is using Typescript. However, when running my test-suite, I come across an error that doesn't allow any component that is using apollo-boost-upload to…

Johnnie
- 197
- 1
- 9
3
votes
1 answer
"Unexpected token" error in babel-loader with inline loaders and require.context
In a basic CRA-app this works just fine:
import MyMDX from '!babel-loader!mdx-loader!./mdx-file.mdx';
But when I try to do the same with require.context, like so:
const mdxContext = require.context('!babel-loader!mdx-loader!../../../../packages',…

o01
- 5,191
- 10
- 44
- 85
3
votes
1 answer
How to run build script in CRA when node_modules is in parent directory?
I have a file structure that looks like this:
/client
|--/src
|--package.json
|--/build
/controllers
/models
app.js
package.json
/node_modules
My client folder has all of the CRA stuff in it, however I gutted the package.json file to only…
user4747724
3
votes
1 answer
ReactJS Module not found: Can't resolve './static/js/myfile.js'
I am trying to learn React and I use "create-react-app". I now have an issue that I find very strange and am not able to solve.
I have a map-structure like this:
administratie
└─ public
└─ static
└─ img
└─ js
└─ src
…

johannes
- 1,270
- 12
- 19
3
votes
2 answers
Fork and install Create React App without publishing on NPM
I would like to fork Facebook's Create React Repo and use it as a dependency instead of their own react-scripts. All tutorials on the subject publish the forked repo to NPM to install via the normal way.
However, my client would prefer to not do…

sidonaldson
- 24,431
- 10
- 56
- 61
3
votes
2 answers
In react with hooks and bootstrap, how do I change chevron as accordion opens?
I have an accordion that opens when I click on the header. I also added a chevron that I want to change the direction when it opens. I'm not sure how to do that with the accordion since I'm not changing states based on a button click.
My accordion…

baumli
- 421
- 5
- 24
3
votes
1 answer
Create React App not working : error @typescript-eslint/eslint-plugin@2.10.0: The engine "node" is incompatible with this module?
I'm not sure why yarn create react app fails. The error message suggest @typescript-eslint/esling-plugin version is not compatible with the node engine. I've also tried yarn cache clean --force but doesn't work. I don't have a package.json to change…

Jereme
- 427
- 7
- 15
3
votes
3 answers
Is there a way to change eslint rules for ejected create-react-app?
I am building an app with React and using NPM.
I have set up my package.json like so
{
"name": "mouseflow-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/core": "7.7.4",
"@material-ui/core": "^4.1.3",
…

devaent
- 432
- 4
- 16
3
votes
1 answer
Deploy CRA to s3 and serve with express
I want to deploy CRA bundles to s3 and serve from cloudfront. But index file should be express view (template, I want to add some data to it). All solutions I've found assume serverless or serve CRA index directly from node.
So, I need index to be…

Mykyta Shyrin
- 312
- 1
- 14
3
votes
2 answers
Cannot install react-app because of a node version problem but I do have the last version installed
All is in the title: I am trying to create a react-app following this tutorial: https://github.com/facebook/create-react-app
But it fails immediately saying the following:
[user@localhost workspace]$ create-react-app projectname
Creating a new…

ava_punksmash
- 357
- 1
- 4
- 13