react-native-react-bridge icon indicating copy to clipboard operation
react-native-react-bridge copied to clipboard

Crash after changing metro.config.js - > node_modules\expo-router\entry.js: traverse is not a function

Open katche70 opened this issue 2 years ago • 7 comments

Describe the bug after changing metro.config.js to module.exports = { ...config, transformer: { ...config.transformer, babelTransformerPath: require.resolve( "react-native-react-bridge/lib/plugin" ), }, }; i can't start react app anymore: node_modules\expo-router\entry.js: traverse is not a function

To Reproduce Steps to reproduce the behavior.

Expected behavior A clear and concise description of what you expected to happen.

Platform:

  • OS: iOS, Android, wen
  • Running on: Device, Browser
  • Version of this package: ^0.11.0

Additional context Web Bundling failed 826ms error: node_modules\expo-router_error.js: traverse is not a function Web node_modules\expo-router/entry.js ░░░░░░░░░░░░░░░░ 0.0% (0/1) Metro error: node_modules\expo-router\entry.js: traverse is not a function

Call Stack MetroBundlerDevServer.getStaticResourcesAsync (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js) process.processTicksAndRejections (node:internal/process/task_queues) async MetroBundlerDevServer.getStaticPageAsync (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js) async (node_modules/@expo/cli/build/src/start/server/metro/MetroBundlerDevServer.js) Web Bundling failed 10ms error: node_modules\expo-router\entry.js: traverse is not a function Web Bundling failed 9ms error: node_modules\expo-router\node\render.js: traverse is not a function Web Bundling failed 12ms error: node_modules\expo-router_error.js: traverse is not a function › Detected a change in babel.config.js. Restart the server to see the new results. You may need to clear the bundler cache with the --clear flag for your changes to take effect.

katche70 avatar Aug 16 '23 14:08 katche70

Facing the same issue!

iabdulhannan avatar Aug 21 '23 11:08 iabdulhannan

Fix!

For me the error was occurring at: node_modules/react-native-react-bridge/lib/plugin/index.js

I modified this var traverse = require('@babel/traverse'); to var _traverse = require('@babel/traverse'); const traverse = _traverse.default;

and the error went away!

iabdulhannan avatar Aug 21 '23 13:08 iabdulhannan

Thanks! I've released a patch 0.11.1. Could you try it?

inokawa avatar Aug 21 '23 13:08 inokawa

Hey! The patch 0.11.1 worked, the error is gone but now I'm facing the following:

ReferenceError: Property 'n' doesn't exist, js engine: hermes.

To reproduce it, just create an Expo project and follow the instructions on this package's Homepage to create a demo project.

iabdulhannan avatar Aug 22 '23 06:08 iabdulhannan

Screenshot 2023-09-14 at 5 53 15 PM

I am also facing same issue with version 0.11.1.

accelerate-dm avatar Sep 14 '23 12:09 accelerate-dm

Having the same issue. Any ideas?

edjiang avatar Sep 20 '23 01:09 edjiang

0.11.2 is released. Thank you for your contribution!

inokawa avatar Sep 23 '23 03:09 inokawa