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

Failed to compile when upgrading react-scripts to 5.0.0. #41

Open
guidowalter opened this issue Mar 16, 2022 · 4 comments
Open

Failed to compile when upgrading react-scripts to 5.0.0. #41

guidowalter opened this issue Mar 16, 2022 · 4 comments

Comments

@guidowalter
Copy link

Hi,

we are trying to upgrade react-scripts (CRA) from 4.0.3 to 5.0.0 (CRA5). This is mainly due to High risk vulnerabilities within the following dependencies:

ansi-html-0.0.7.tgz
node-forge-0.10.0.tgz
com.google.code.gson-gson-2.8.0.jar
browserslist-4.14.2.tgz
url-parse-1.5.4.tgz
css-what-3.4.2.tgz
ansi-regex-3.0.0.tgz
nth-check-1.0.2.tgz
immer-8.0.1.tgz
follow-redirects-1.14.7.tgz
glob-parent-3.1.0.tgz
ejs-2.7.4.tgz
jdom2-2.0.6.jar

As CRA5 has already or will update these dependencies, we have to upgrade as well due to our internal policies.
When just using react-scripts 5.0.0 (web), we got

Failed to compile.

Module not found: Error: You attempted to import C:\Temp\React-native-universal-monorepo\react-native-universal-monorepo\packages\web\node_modules\react-dom which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/.

As we thought, this might be depended on CRACO addressing Webpack5 as well, we tried to update craco to 7.0.0-alpha.3 but this resulted in the same compiler error.

So my question is, due have any information on how to use CRA5 with RNUM or do you have any plans to upgrade this to CRA5 in the future? Any help /information is apprciated!

Thanks

Guido

@mmazzarolo
Copy link
Owner

Hey @guidowalter !
I haven't tried updating CRA yet and I don't have a plan to try to do so yet, sorry!

@guidowalter
Copy link
Author

Hi @mmazzarolo.
thanks for the quick reply. We will then wait for the craco team to finish their work on version 7 and see if this might fixes this error or at least give more indication in regards to the webpack-config what went wrong. I'll update this issue when we have more news on that.

@mmazzarolo
Copy link
Owner

Thanks!

@msridar
Copy link

msridar commented Mar 19, 2024

Any idea if this issue is solved yet ?

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

No branches or pull requests

3 participants