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
Could not load react-native-web/Libraries/Utilities/codegenNativeComponent #2292
Comments
Your bundler should be using the web implementation of react-native-safe-area-context instead of the native export. If you continue to have trouble loading the web implementation you should open an issue against their repository |
@necolas I have a draft story on medium with my experience with bundling react-native for the web with webpack, feel free to comment on it as I went through all the problems that are posted in an issue here every few days: |
Hi @necolas , so the issue I'm having with vite, is more of the Utilities/Platform, on webpack or CRA this issue is quite easy to resolve, but webpack is just too messy or too big. I've been able to solve the issue on this thread, but for some reason I'm having issue with aliasing for Utilities/Platform |
@mmomtchev thank you for that! It worked for me. |
The problem
I have a react native application that i'm trying to use on web as well
When I'm trying to build I get the following error:
The correct file path is:
react-native/Libraries/Utilities/codegenNativeComponent.js
It seems that the error comes from
react-native-safe-area-context
And it occurs because of
react-native-web
alias in myvite.config.ts
:What does it mean?
Is
react-native-web/Libraries/Utilities/codegenNativeComponent
really missing in the implementation ofreact-native-web
?How to reproduce
https://stackblitz.com/edit/vitejs-vite-betvra
Simplified test case:
Steps to reproduce:
npm i
npm run build
Expected behavior
The web app will work fine with the native components
Environment (include versions). Did this work in previous versions?
The text was updated successfully, but these errors were encountered: