Questions tagged [cra]
38 questions
2
votes
0 answers
Can someone tell me how I can add PostCSS to CRA correctly?
All I found was to add a postcss cli or do an eject and change the webpack configuration
Can anyone tell me how to do it properly with eject?

Павел Бродкин
- 31
- 2
2
votes
1 answer
CRA 5 upgraded to Webpack 5. How does it help using Webpack Module Federation with CRA without ejecting?
Module Federation requires Webpack 5.
The new Create React App (CRA) v5 released last December was upgraded to Webpack 5.
How does it help using Webpack Module Federation with CRA without ejecting?
Any guide on how to do it in a clear way?

PedroF
- 95
- 1
- 9
2
votes
1 answer
Keycloak acts as if its uninitialized after a hard page refresh
First of all, thanks in advance to anyone who reads my question and comments. I have a CRA app that is using keycloak-js and ReactKeycloakProvcer from `@react-keycloak/web. When you first load the application page and login, keycloak is initialized…

Griff
- 1,796
- 3
- 23
- 48
2
votes
0 answers
[CRA][Vscode] Absolute Import not work when create new file
I got this problem in VS code, only within this project.
When I created a new file, I can't use Absolute Import Path, I have to restart the VS Code or re-run npm start
It is time-consuming when I have to re-run the project or restart VS code every…

HaiNguyen
- 21
- 1
1
vote
0 answers
how to modify webpack chunks name based on browser (client) time like chunk.js?timestamp=browserTime
i have a react application in webpack setting the chunks are getting generated like
50b74e3a.chunk.js
every time its got build the hash changed by webpack but that is not useful for cache busting
in browser , there its cached the old chunk file…

jsBuddy
- 49
- 7
1
vote
0 answers
Upgarding react-scripts from v4 to v5 gives strange error Module build failed (from ../node_modules/babel-loader/lib/index.js)
I am using CRA and when upgrading react-scripts from v4.0.3 to v5.0.1 I get this strange error
Module build failed (from ../node_modules/babel-loader/lib/index.js):
TypeError: SOME_FILE_IN_THE_PROJECT.tsx:…

ka222jm
- 71
- 1
- 3
- 5
1
vote
0 answers
CRA + WebPack(react-scripts): Configure relative path for images other than PUBLIC_URL
I've below directory structure for my react app.
src
assets
dummy.svg
scss
dummy.scss
js
dummy.js
Below is the standard build format generated in CRA.
build
static
js
…

jakshay
- 86
- 5
1
vote
1 answer
How to add background image class to tailwind config in CRA application
I am trying to use image as background using tailwind css in Create react app. But can't figure out how to add background image class.
The error:
Module not found: Error: Can't resolve './src/images/pages/login.svg' in 'C:\src'
what i…

Maielo
- 692
- 1
- 6
- 20
1
vote
1 answer
How do I set React (create-react-app) to display image
I have create-react-app application and I am unable to display the image.
In a code I have
use .htaccess
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
Options +FollowSymLinks…

Aleš Vykoukal
- 21
- 3
1
vote
2 answers
tailwind build result file is small
I'm trying to use TailwindCSS and followed the installation process like below. But what I get is a tailwind.css file with only 369 lines which seems less than others' tailwind result files (and makes me unable to use tailwind styles). Are there any…

WoW
- 21
- 4
1
vote
1 answer
get total bundle size in create-react-app (CRA)
Running yarn build in my CRA app prints out useful information including bundle sizes.
Is there a way to extract just the Javascript and CSS bundle sizes?

Sergey Lukin
- 471
- 2
- 17
0
votes
1 answer
Source maps are not properly showed in create-react-app
I was wondering why the first and the second lines are referring to instrument.js but the third line can properly show the source which is Toolbar.tsx. Source maps are generated by webpack. How can I make it show the correct sources?

Devisfun
- 1
- 1
0
votes
1 answer
Cannot Find Module 'block-stream'
I'm trying to make a new react-js site using npx create-react-app
The Error I get is Error: Cannot find module 'block-stream'
I redownloaded node and tried again but still getting the same error
what can I try to fix this?

beom
- 1
0
votes
1 answer
sh: 1: react-app-rewired: not found when building Dockerfile
I'm getting the following error when trying to build a Create React App v5.0.1 using node 16.15.0 on docker.
It was working fine using node 14.17.0, but due to a failure when I was starting the project in this version I needed to update to node…

niltonxp
- 342
- 4
- 11
0
votes
1 answer
import css does not work for class name with dashes for Webpack 5 and css loader 5
Trying to get a third party library that is importing css to work with my app.
I am using webpack v5 and css-loader v5. Since the upgrade from webpack v4 to v5, the 3rd party library styles are no longer working because css-loader doesn't allow…

Stanley
- 2,798
- 5
- 22
- 44