Questions tagged [react-scripts]

Package containing various scripts for running applications created via create-react-app

Package containing various scripts for running applications created via create-react-app

501 questions
4
votes
5 answers

How do I change localhost:3000 to custom.domain in react

"scripts": { "start": "cross-env NODE_PATH=src react-scripts start", "build": "cross-env NODE_PATH=src react-scripts build", } How do I change localhost:3000 to custom.domain in react
4
votes
1 answer

ReactJS Environment variables are undefined on development

I cannot use my environment variables on my development (localhost) with ReactJS. I made sure of following: My .env file is in the root directory My env variable has a prefix of REACT_APP_* and the usage is process.env.REACT_APP_* My env variable…
4
votes
2 answers

React project crashes with many allocation failures on Heroku but runs on local dev

My React calendar app works well on a local development build but it gives many allocation failures when it's deployed to Heroku. Here is the error from the Heroku logs: 2021-08-29T06:50:16.143215+00:00 app[web.1]: <--- Last few GCs…
Innextinit
  • 117
  • 11
4
votes
3 answers

internal/modules/cjs/loader.js:888 throw err;

I have a project on Github that ignores the node_modules folder, so I changed my computer and and cloned the repository again. I used the npm-install-all install all node dependencies, it used to work. But today when doing this and running…
4
votes
0 answers

ReferenceError: Cannot access {variable name} before initialization

I updated react-scripts@^4.0.3 as well as typescript@~3.7.2 to the latest however when I run npm run start I get the following error : ReferenceError: Cannot access {variable name} before initialization I'm aware of "Temporal Deadzones" however…
4
votes
1 answer

electron & react: No resource with given URL found, DevTools failed to load SourceMap

For production (mac dmg) builds of my electron app, I am unable to trigger location.reload(), connect to redux-dev-tools, and the sourcemap fails to load. When the app is loaded, the console warns that it cannot load the sourcemap: The index.html…
Arthur
  • 2,622
  • 4
  • 28
  • 46
4
votes
1 answer

Failed to load config "react-app" to extend from. Referenced from: C:\\package.json

package.json "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] },
4
votes
0 answers

Load manifest.json from any React route

tl;dr How can the manifest.json be made accessible from any route within a React application (react-scripts)? Context I'm working on an app that was built to work in evergreen browsers; however, I now have to also make it possible to use the app in…
4
votes
2 answers

react-scripts build a file into `build` folder, from a different folder than `public`

I have a react app. In my package.json: "build": "react-scripts build", After running this build script: npm run build Everything is built into the build folder and any files from the public folder get copied to the root of the build folder as…
StefanBob
  • 4,857
  • 2
  • 32
  • 38
4
votes
1 answer

create-react-app how to compile specific .ts file to .js file in the build process?

Currently, $ npm run build compiles files from src/ into /build and everything is working fine. However, there's some specific TypeScript file, src/integer.ts, that I want to compile to its own JavaScript file, build/integer.js and all the other…
M. M
  • 520
  • 1
  • 5
  • 9
4
votes
3 answers

react jsconfig.json ignores paths

I have the following jsconfig.json in the root of my react app: { "compilerOptions": { "baseUrl": "./src", "paths": { "rmv": ["components/rmv/*"] } } } and there is a helper.jsx file located in…
Philipp Chapkovski
  • 1,949
  • 3
  • 22
  • 43
4
votes
0 answers

Why setupProxy.js does not log in react app?

I have ejected react scripts, and I have the following in my setupProxy.js. module.exports = function(app) { app.use( proxy({ changeOrigin: true, logLevel: "debug", onProxyReq: function onProxyReq(proxyReq, req, res) { …
sotiristherobot
  • 259
  • 3
  • 10
4
votes
1 answer

Jest test passes locally but fails in azure devops

I have a react application using react-scripts 3.2.0 This is my test : jest.mock('./../shared/utils/getRequestWithDispatchUsing', () => ({ __esModule: true, default: () => () => () => () => 'getRequestWithDispatchUsing is success', })); …
Melchia
  • 22,578
  • 22
  • 103
  • 117
4
votes
2 answers

Debugging React App in Visual Studio 2019 does not work

I created a ASP.NET Core 3 React and Redux project using the template. I am trying to debug the TS files. When I try to set a break point in Visual Studio in the source TS file none of the break points go where I want them. If I try to step through…
4
votes
1 answer

react-scripts build freezes at "Creating optimized build"

I have upgraded my CRA project to use react-scripts 3.2.0 When I run npm run build I get the "Creating an optimized production build..." message, but then nothing happens, its just stuck forever. Environment: node: v12.13.1 npm: 6.12.1 Project…
naomi
  • 2,583
  • 2
  • 22
  • 39