Open RohovDmytro opened 1 year ago
Okay. Don't ask me how, don't ask me when, don't make any blood tests, but what I've figured out is that it is somehow connected to the react-native-safe-area-context module. AFIACT, it does not get replaced during aliasing.
Adding a manual alias "react-native-safe-area-context": "react-native" throws a bunch of errors but makes my scripts run first time in 3 days.
Tea time.
A note, that helped me:
Hey @RohovDmytro, would you like to update the docs and add a note about your finding? 🙏🏽
I'm quite sure @lukewalczak it's a too dirty solution. It produces a bunch of warnings and my first hacky attempt to make things work.
My best guess is react-native-paper
should change a way it uses SafeAreaView in case of a build for web. I've never read about a special attention devoted to safe area in context of react-native-web build, so I'm not sure it's a root cause.
My best guess is react-native-paper should change a way it uses SafeAreaView in case of a build for web. I've never read about a special attention devoted to safe area in context of react-native-web build, so I'm not sure it's a root cause.
If you will have some more findings related to that topic, please collect them in that issue. Currently, I'm busy with other things, so I won't be able to dive into that area, but the issue will remain open.
Root issue found.
So the webpack config must also contain the web.js
item AND it should be on top of the list:
extensions: [
'.web.js',
...(other || []),
]
It is important to have web.js
on top of the array so the libraries (suck as react-native-paper) will prioritize loading web.js files.
Totally worthy adding this to the web support section: https://callstack.github.io/react-native-paper/using-on-the-web.html
Hey @RohovDmytro, could you please create a PR into the docs with the updates based on your findings?
Current behaviour
react-natie-web & remotion setup fails to compile web version.
Expected behaviour
Compiling nicely.
How to reproduce?
Preview
No screenshots.
What have you tried so far?
I've followed the react-native-paper web guide and different variations of loaders, but still no success.
It does not work both with expo or without.
What I find strange is I do make a swap of react-native & react-native-web, but the error still persists with react-native files.
My 'uneducated guess' is react-native-paper somehow manages to load react-native files dynamically and they do not get swapped during compilation process. Not sure though.
Your Environment