create-react-app
create-react-app copied to clipboard
can't run yarn build get issue from Css Minimizer plugin Error: Cannot find module 'normalize-url'
Describe the bug
Can't build fresh project with yarn build
Did you try recovering your dependencies?
yes ❯ yarn --version 1.22.15
Which terms did you search for in User Guide?
Css Minimizer plugin Error: Cannot find module 'normalize-url'
Environment
npx create-react-app --info
Environment Info:
current version of create-react-app: 5.0.0 running from C:\Users\kowalski\AppData\Local\Yarn\Data\global\node_modules\create-react-app
System: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz Binaries: Node: 17.4.0 - C:\Files\nodejs17\node.EXE Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 8.3.1 - C:\Files\nodejs17\npm.CMD Browsers: Chrome: Not Found Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.62) Internet Explorer: 11.0.19041.1202 npmPackages: react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-scripts: 5.0.0 => 5.0.0 npmGlobalPackages: create-react-app: Not Found
Steps to reproduce
(Write your steps here:)
- yarn create react-app my-app2 --template typescript
- cd my-app2
- yarn build
Expected behavior
should get builded app
Actual behavior
❯ yarn build yarn run v1.22.15 $ react-scripts build Creating an optimized production build... Failed to compile.
static/css/main.a6b5f62b.css from Css Minimizer plugin Error: Cannot find module 'normalize-url' Require stack:
- D:\aaaa\my-app2\node_modules\postcss-normalize-url\dist\index.js
- D:\aaaa\my-app2\node_modules\cssnano-preset-default\dist\index.js
- D:\aaaa\my-app2\node_modules\cssnano\dist\index.js
- D:\aaaa\my-app2\node_modules\css-minimizer-webpack-plugin\dist\minify.js
- D:\aaaa\my-app2\node_modules\jest-worker\build\workers\threadChild.js

Reproducible demo
please, need help i stuck on this
Did you find any solution?
Hello Guys, any update on this issue ?
yes i faced the same issue , i solved it
any workaround @anazbinnoushad pls ?
i just looked all of my css files and found an error on one of my css file it was on a media query statement
yarn add --dev postcss-normalize it worked for me
any luck with this issue guys, I am stuck on this too
Please anyone has any fix for this..?
Failed to compile.
static/css/main.be5a105b.css from Css Minimizer plugin Error: Invalid mapping: {"generated":{"line":1,"column":3846},"source":"static/css/main.be5a105b.css","original":{"line":1368,"column":null},"name":null}
error Command failed with exit code 1.
I get a simular message to this issue above after updating from CRA4 to 5.
I fixed it bgy going through all css files in the project commenting out the whole file until this error goes away. Then going back thorugh re-instanting rules until I found the problematic bit.
So if you are getting this you have some invaild css, but you get no clue in the error as to where, and must spend ages doing a manual binary search of your codebase.
i just looked all of my css files and found an error on one of my css file it was on a media query statement
Mantap, thx brother, worked for me
Hello Guys, any update on this issue ?
Just check the .css files, probably u have some syntax error there.....
run into the same problem which was caused by a comment line (double backward slash) ....// , yarn build -works fine after removing those lines
any workaround @anazbinnoushad pls ?
I tried to figure out your code problem and solved this way. First, remove your build folder and yarn.lock file, then, yarn install and then yarn build that is it, it works here : )
please, need help i stuck on this
I tried to figure out your code problem and solved this way. First, remove your build folder and yarn.lock file, then, yarn install and then yarn build that is it, it works here : )
I just removed the files from 'App.css' that React creates automatically and it worked for some reason
I had the same issue, i had an error of sintax inside of one of my css file. I remove this error, and then i was able to compile my project correctly. Regards
I ran into this error when trying to update several packages in my react project. I was trying to upgrade normalize-url v6.0.1 to v7.0.3, but this threw the error so I just stayed on 6.0.1.
For me was this piece of code that was blocking it:
@font-face { font-family: 'MyFont'; src: url("./fonts/"); src: url("./fonts/?#iefix") format("embedded-opentype"); src: url("./fonts/11469c307f0de6481e3a04cc5d54ae93.woff2") format("woff2"); src: url("./fonts/11469c307f0de6481e3a04cc5d54ae93.woff") format("woff"); src: url("./fonts/11469c307f0de6481e3a04cc5d54ae93.ttf") format("truetype"); src: url("./fonts/11469c307f0de6481e3a04cc5d54ae93.svg#Uber Move Text") format("svg"); }
I had the same issue. I had an issue in my footer CSS where I used [ ] vs { }
Thank you everyone!
not build react js -> This Error can u find this solution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
static/css/main.da4e6500.css from Css Minimizer plugin Error: Unexpected '/'. Escaping special characters with \ may help.