You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am trying to add react-native-web to an existing react-native project based on Ignite Bowser template. I have tried with many variation of versions, config of webpack, etc.. without success.
Main version and library I am using, see below for full config files.
Here is my main issue: when running my react native web app, I get the following error message:
$ webpack serve --mode=development --config webpack.config.js
<w> [webpack-dev-server] "hot: true" automatically applies HMR plugin, you don't have to add it manually to your webpack configuration.
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://10.0.1.229:8080/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/rdewolff/Projects/meetme/dev/meetme-mobile/public' directory
asset meetme.bundle.js 14.8 MiB [emitted] (name: app)
asset index.html 458 bytes [emitted]
runtime modules 28.1 KiB 16 modules
orphan modules 2.45 KiB [orphan] 9 modules
modules by path ./node_modules/ 9.41 MiB
javascript modules 9.26 MiB 2805 modules
json modules 147 KiB 5 modules
modules by path ./app/ 2.09 MiB
javascript modules 2.02 MiB 215 modules
json modules 72.2 KiB 3 modules
modules by path ./*.json 8.74 KiB
./app.json 50 bytes [built] [code generated]
./package.json 8.69 KiB [built] [code generated]
./index.web.js 492 bytes [built] [code generated]
external "react-native" 42 bytes [built] [code generated]
./util.inspect (ignored) 15 bytes [built] [code generated]
ws (ignored) 15 bytes [optional] [built] [code generated]
ERROR in ./node_modules/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js 21:5
Module parse failed: Unexpected token (21:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const sizesDiffer = require('../../Utilities/differ/sizesDiffer');
|
> type ReturnBoolType = <V>(V) => true;
| type BoolifiedDeprecatedViewStylePropTypes = $ObjMap<
| typeof DeprecatedViewStylePropTypes,
@ ./node_modules/react-native-screens/lib/module/native-stack/views/FontProcessor.js 1:229-305
@ ./node_modules/react-native-screens/lib/module/native-stack/views/HeaderConfig.js 1:436-462
@ ./node_modules/react-native-screens/lib/module/native-stack/views/NativeStackView.js 1:922-947
@ ./node_modules/react-native-screens/lib/module/native-stack/index.js 1:553-587
@ ./app/navigation/root-navigator.web.tsx 1:286-330
@ ./app/navigation/index.ts 1:76-103
@ ./app/app.web.tsx 1:555-578
@ ./index.web.js 1:241-261
ERROR in ./node_modules/react-native/Libraries/ReactNative/AppContainer.js 21:5
Module parse failed: Unexpected token (21:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const View = require('../Components/View/View');
|
> type Context = {rootTag: number, ...};
|
| type Props = $ReadOnly<{|
@ ./node_modules/react-native-screens/lib/module/native-stack/views/NativeStackView.js 1:765-823
@ ./node_modules/react-native-screens/lib/module/native-stack/index.js 1:553-587
@ ./app/navigation/root-navigator.web.tsx 1:286-330
@ ./app/navigation/index.ts 1:76-103
@ ./app/app.web.tsx 1:555-578
@ ./index.web.js 1:241-261
webpack 5.73.0 compiled with 2 errors in 3830 ms
The problem seems to be very similar to the one described and discussed here : #2052
I tried checking source code from other app like https://github.com/criszz77/luna that have it working but could not find the difference and make it work in my project. It seems to me this is a webpack configuration issue to use react-native-web properly.
The error is located specifically here in react-native-screens:
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
How can I fix the babel/webpack config to handle properly react-native-screens that is importing the file? Specifically in an external lib?
I have the following ideas in mind:
Fix the webpack of rnw to work with that use case
Use another lib like react-router-dom for the navigation to not use the package causing problem.
Use eslib ? Seems not very common and not sure I want to take this road.
I'd love to get some ideas or feedback on how to proceed with that error.
Of course I have tried that and done it, check my config files. It's all in there as far as I can see.
But when using react-navigation and react-native-screens it doesn't work anymore. Isn't there a config item I am missing?
Is there an existing issue for this?
Describe the issue
Hi all
Am trying to add
react-native-web
to an existing react-native project based on Ignite Bowser template. I have tried with many variation of versions, config of webpack, etc.. without success.Main version and library I am using, see below for full config files.
Here is my main issue: when running my react native web app, I get the following error message:
The problem seems to be very similar to the one described and discussed here : #2052
I tried checking source code from other app like https://github.com/criszz77/luna that have it working but could not find the difference and make it work in my project. It seems to me this is a webpack configuration issue to use react-native-web properly.
The error is located specifically here in
react-native-screens
:How can I fix the babel/webpack config to handle properly
react-native-screens
that is importing the file? Specifically in an external lib?I have the following ideas in mind:
I'd love to get some ideas or feedback on how to proceed with that error.
Config files
package.json
babel.config.js
webpack.config.js
Expected behavior
Expecting the project to start and display the web app properly.
Steps to reproduce
n/a
Test case
n/a
Additional comments
No response
The text was updated successfully, but these errors were encountered: