Questions tagged [cra]

38 questions
26
votes
9 answers

Antd source map not supported in React

I have an issue regarding the integration of Ant Design library in a CRA (create-react-app). After I have tried to integrate it as it is required in their documentation, without integration of Craco, I always get these 4 warnings: WARNING in…
SB7x
  • 453
  • 1
  • 3
  • 7
12
votes
3 answers

Typescript CRA with MSW: failed to parse source map

I have created a Create React App application with typescript template build in, then i installed MSW with npm and created files based on MSW install guide. It's working perfectly for jest, but for browser when im using start script i got a bunch of…
nero1141
  • 131
  • 1
  • 4
11
votes
1 answer

Webpack 5 in Ceate React App can't resolve not fully specified routes

We are developing a react library and recently noticed, that it throws an error when we want to consume it with a new (webpack 5) Create React App. It complains about this: "BREAKING CHANGE: The request failed to resolve only because it was resolved…
user3130985
  • 161
  • 1
  • 10
8
votes
1 answer

Updating CRA from version 4 to version 5 breaking babel-jest

After updating CRA to version 5. When running npm test I see the following error: Determining test suites to run... ● Test suite failed to run TypeError: babelJest.createTransformer is not a function at Object.
Felipe Plets
  • 7,230
  • 3
  • 36
  • 60
6
votes
1 answer

PostCSS Loader has been initialized using an options object that does not match the API schema

I'm having this problem after upgrading react-scripts from version 4 to 5! I use customize-cra with the option below: module.exports = override( addLessLoader({ lessOptions: { javascriptEnabled: true, modifyVars: { …
niltonxp
  • 342
  • 4
  • 11
6
votes
2 answers

Workaround for cache size limit in Create React App PWA service worker

I'm developing a PWA starting from a blank CRA template. The application needs to fully work offline after the installation, so I'm exploiting Workbox's methods to precache all static content. Unfortunately I have severals contents between 5 and 10…
6
votes
1 answer

prerender.io .htaccess variable - Reactjs CRA

I set up prerender.io for CRA and it works well, but when bot hits URL without parameters it puts in the end of URL - string ".var" I tried variations of (.*) but it seems not working. Any ideas? Here is .htaccess file Options…
Tiffany
  • 487
  • 2
  • 13
5
votes
1 answer

Buffer is not defined, after migrating from CRA(create react app) to vite

After having declared and done all the config files, when I start the server I get Buffer not defined and the error points to an npm module. Uncaught ReferenceError: Buffer is not definedat node_modules/jsesc/jsesc.js
Elyess Eleuch
  • 141
  • 1
  • 5
4
votes
1 answer

Adding another entry file to webpack w/o being injected to HTML file

I'm using CRA with CRACO to add another entry file to webpack configuration. Here is the code: module.exports = { webpack: { configure: (webpackConfig, {paths}) => { return { ...webpackConfig, entry: { main:…
Edgar Barber
  • 345
  • 3
  • 13
4
votes
3 answers

CRA project node v14.17.0 - Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'node:vm'

I'm getting the following error when trying to start a CRA project running with node 14.17.0 -> Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'node:vm' Compiled with problems:X ERROR in ./src/app.css…
niltonxp
  • 342
  • 4
  • 11
4
votes
2 answers

is it required babel configuration when I use vite in place of webpack

Recently I was create react app using vite , it is lightweight , less config and fast then compare with webpack . now my question is , is it required bable configuration in Vite project
3
votes
1 answer

Yarn start met with [HPM] Missing "target" option. Example: {target: "http://www.example.org"}

I cloned a CRA repo and switched from npm to yarn. after running yarn start I am met with an error that says [HPM] Missing "target" option. Example: {target: "http://www.example.org"} error Command failed with exit code 1. info Visit…
Dayvvo
  • 231
  • 1
  • 2
  • 8
3
votes
0 answers

How can I apply module augmentation for a peer dependency?

My scenario I am creating a TypeScript package using TSDX (react-storyook template) with a MUI v5 peer dependency. In the package, I am augmenting the theme in order to customise it, as documented by MUI. I am then consuming this package by a…
hasanas
  • 101
  • 3
2
votes
2 answers

update PWA react app (using CRA) with user clicked button through service worker

I want to update PWA application when new content is available. Since we can't access DOM from service worker, how can I exactly do that? The service worker correctly recognize the new content, but I can't bind a hook or context to show my modal or…
2
votes
0 answers

With CRA upgrade from 3.4.1 to 4.0.3 tests are running much slower

I have a CRA project which I updated from 3.4.1 to 4.0.3 With the update on 4.x.x it also updated Jest to version 26.x.x After this update, the tests are 3x slower than before the upgrade. I suspect it has to do with the new Jest version. Some…
Bogdan Lungu
  • 786
  • 1
  • 9
  • 16
1
2 3