Replies: 1 comment
-
I think adding to my babel.config.js fixed it? Now I have more issues. SyntaxError: Invalid or unexpected token |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
My code:
https://github.com/UberMC/react-native-web-react-navigation-ssr
Following these instructions:
https://reactnavigation.org/docs/server-rendering/
Following the guide, I'm able to get client-side rendering working however.
For server-side rendering
`Error: Cannot find module '../Utilities/Platform'
Require stack:
Seems to be resolved by copying and pasting node_modules/react-native/utilities/Platform.ios.js to node_modules/react-native/utilities//Platform.js
Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules at invariant (/Users/ubermc/Documents/GitHub/boilderplate-rnw-rn-ssr/rnWebSSR/node_modules/invariant/invariant.js:40:15) at Object.<anonymous> (/Users/ubermc/Documents/GitHub/boilderplate-rnw-rn-ssr/rnWebSSR/node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:177:3) at Module._compile (internal/modules/cjs/loader.js:1157:30) at Module._compile (/Users/ubermc/Documents/GitHub/boilderplate-rnw-rn-ssr/rnWebSSR/node_modules/pirates/lib/index.js:99:24) at Module._extensions..js (internal/modules/cjs/loader.js:1177:10) at Object.newLoader [as .js] (/Users/ubermc/Documents/GitHub/boilderplate-rnw-rn-ssr/rnWebSSR/node_modules/pirates/lib/index.js:104:7) at Module.load (internal/modules/cjs/loader.js:1001:32) at Function.Module._load (internal/modules/cjs/loader.js:900:14) at Module.require (internal/modules/cjs/loader.js:1043:19) at require (internal/modules/cjs/helpers.js:77:18) { name: 'Invariant Violation', framesToPop: 1 }
I think? this is because the alias of react-native to react-native-web isn't working but I have in my .babelrc
{ "plugins": [ [ "@babel/plugin-transform-async-to-generator" ], [ "module-resolver", { "alias": { "^react-native$": "react-native-web" } } ] ] }
Beta Was this translation helpful? Give feedback.
All reactions