Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create build after upgrading the app to react-scripts@5.0.0 #12024

Closed
shubhdwiv12 opened this issue Feb 5, 2022 · 2 comments
Closed

Comments

@shubhdwiv12
Copy link

shubhdwiv12 commented Feb 5, 2022

Describe the bug

I have upgraded my project from react-scripts@4.0.1 to react-scripts@5.0.0. npm start is working fine but when I am going for the build, I am getting the below error. The build is working fine when I downgraded the application to react-scripts@4.0.0

_Creating an optimized production build...
Failed to compile.

static/css/main.161533bd.css from Css Minimizer plugin
Error: Unexpected '/'. Escaping special characters with \ may help._

Did you try recovering your dependencies?

Yes, I tried recovering my dependencies with react-scripts@5.0.0, still, it is causing but working fine with react-scripts@4.0.1

npmPackages:
react: ^17.0.1 => 17.0.2
react-dom: ^17.0.1 => 17.0.2
react-scripts: 5.0.0 => 5.0.0
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. There are different third-party dependencies, I have been using along with custom CSS.
  2. The Application is working fine and the build is getting created with react-scripts@4.0.1
  3. Looks like It is a CSSMinimizerPlugin causing the issue and in the older webpack version, the build is getting created.

Expected behavior

Build should be created.

Actual behavior

image

@shubhdwiv12
Copy link
Author

shubhdwiv12 commented Feb 5, 2022

Have got the issue of why it is happening after much effort, It is a comment issue (/* */) in the application, if you are facing the same issue, try to check your CSS files and see if you put any wrong comments or check the relative path for the images or background images which you might have given wrong can cause this issue. Hope it helps.

@shubhdwiv12
Copy link
Author

I request the team to add a extra check so that such issues can be taken care of during the npm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant