Questions tagged [react-app-rewired]

a tool that allows for easy overriding of create-react-app webpack configs without having to eject

88 questions
20
votes
2 answers

Webpack taking ages to load page AFTER build is complete

We're using create-react-app (with react-app-rewired) on a very large monolith. We've done some improvements to the build time (got it down to approx 20s), but after the build is complete (following a yarn start) the application takes a good 2…
WillKre
  • 6,280
  • 6
  • 32
  • 62
11
votes
4 answers

You may need an additional loader to handle the result of these loaders (upgrading Monaco Editor)

I wanted to upgrade the version of Monaco Editor to v0.31.1. I did npm install monaco-editor@0.31.1, and the recompilation by sudo PORT=8000 HTTPS=true ./node_modules/.bin/react-app-rewired start gave me the following error: Failed to…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
8
votes
2 answers

Jest: "Directory in the roots[0] option was not found"

I am trying to set up monorepo to run all of its Jest tests at once. In each package, I'm using react-app-rewired to get Babel to transpile code imported from other packages without ejecting from create-react-app, as described in this…
mrwnt10
  • 1,234
  • 1
  • 17
  • 28
8
votes
3 answers

Absolute path not working in create-react-app

As per this documentation I created a jsconfig.json file in my root directory in order to be able to import components using absolute paths in my React Application (which was set up using create-react-app). Unfortunately this didn't work. I tried…
5
votes
1 answer

How to drop support for IE, and prevent babel transpilation to ES5 in order to gain performance gain

Currently I am using default webpack config of Create React App for babel transpilation. It seems that default babel-loader (in CRA config) uses "babel-preset-react-app". Now all I want is to prevent the transpilation of JS files to ES5 since I…
5
votes
1 answer

create-react-app integrate with storybook 6.1.6 and build has error

create-react-app version react: v17.0.1 react-scripts: v4.0.1 storybook version @storybook/react: v6.1.6 @storybook/addon-docs: v6.1.6 @storybook/core: v6.1.6 and i could run yarn start to run react app and could run start-storybook -p 9009 -s…
4
votes
1 answer

Cannot read property 'use' of undefined, react-app-rewired

I have a project made with create-react-app with which it has been working well, a template was incorporated, all good until I wanted to start working with TypeScript, I followed the recommendations of the documentation, i configured eslintrc.js, my…
Richard
  • 193
  • 3
  • 9
4
votes
1 answer

Change antd variables at runtime with craco

I have to be able to change ant design variables at runtime (not via theme less files). I've found plenty of examples of this using customize-cra and react-app-rewire-less, but none seem to work with craco. I have to use craco because I'm also using…
Mateus Wolkmer
  • 706
  • 4
  • 26
4
votes
1 answer

How to change build path for react-app-rewired

I am trying to change the build path for react-app-rewired in the file config-overrides.json as mentioned here. module.exports = { paths: function (paths, env) { paths.appBuild = 'C:\\Projects\\jhipster\\src\\main\\webapp\\app'; …
uzzi
  • 551
  • 2
  • 9
  • 29
4
votes
1 answer

Error: Cannot find module 'C:\XXX\XXX/config-overrides'

I have created a sample react/redux/.net core app by using this Tutorial. But when I try to start the application with npm start I get the 'cannot find module error'. I have tried to clean the app by running the following commands: npm cache clean…
Marko
  • 1,291
  • 1
  • 21
  • 37
3
votes
1 answer

× Unhandled Rejection (Error): invalid fragment object (argument="value", value=

I am new to Smart Contracts. I am unable to read a smart contract from Binance test network. I keep getting an Unhandled Rejection every time I attempt to read my smart contract using ethers.js. Error Unhandled Rejection (Error): invalid fragment…
3
votes
1 answer

Upgrading to create-react-app version 4.0 with react-app-rewired: server start error

I've been searching the Web and can't find this situation mentioned anywhere, although it must be not uncommon. I've been using create-react-app (version 3.4.x) with react-app-rewired [primarily in order to enable decorator support (for MobX)…
mjh
  • 3,508
  • 3
  • 19
  • 19
3
votes
1 answer

How to load a typings file as text with Webpack and React?

For setting up a Monaco editor instance I want to add a typings file for a custom lib. When mounting the editor I call: public componentDidMount(): void { languages.typescript.javascriptDefaults.addExtraLib( typings, …
Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
3
votes
2 answers

React build failed: cannot read property 'name' of undefined

I'm using create-react-app template with typescript. On my local pc, run build successfully, but when run in CI server, build failed. build error ./src/store/redux/info/index.ts Syntax error: Cannot read property 'name' of undefined…
Jiwoo Hong
  • 33
  • 1
  • 3
2
votes
1 answer

How to perform tree shaking for lodash in a create-react-app project?

I need to perform tree-shaking to reduce bundle sizes where lodash and some other libraries are being used. I've converted all lodash imports like this: import {isEmpty} from "lodash"; But still bundle size is not getting reduced. To use plugins…
1
2 3 4 5 6