Metro crashes when debugging with Hermes, `Unknown device with ID [n]`

See original GitHub issue

Summary

When debugging a dev build, SDK 45, occasionally Metro will crash with logs as shown below. I think this is related to an out-of-date/incorrect debugging websockets manifest at http://localhost:8081/json?

What platform(s) does this occur on?

Android

SDK Version

45

Environment

  expo-env-info 1.0.3 environment info:
    System:
      OS: Linux 5.17 Debian GNU/Linux 10 (buster) 10 (buster)
      Shell: 5.0.3 - /bin/bash
    Binaries:
      Node: 16.13.1 - /tmp/yarn--1656011463156-0.05934845852186177/node
      Yarn: 1.22.15 - /tmp/yarn--1656011463156-0.05934845852186177/yarn
      npm: 8.1.2 - /usr/local/bin/npm
    npmPackages:
      expo: ^45.0.0 => 45.0.5 
      react: 17.0.2 => 17.0.2 
      react-dom: 17.0.2 => 17.0.2 
      react-native: 0.68.2 => 0.68.2 
      react-native-web: 0.17.7 => 0.17.7 
    Expo Workflow: bare

Reproducible demo

expo_1  | Logs for your project will appear below. Press Ctrl+C to exit.
expo_1  | [19:01:39] Started Metro Bundler
expo_1  | [19:02:49] Android Bundling complete 4707ms
expo_1  | Error: Unknown device with ID 2
expo_1  |     at WebSocketServer.<anonymous> (/build/app/node_modules/metro-inspector-proxy/src/InspectorProxy.js:179:17)
expo_1  |     at WebSocketServer.emit (node:events:390:28)
expo_1  |     at /build/app/node_modules/metro/src/index.js:234:44
expo_1  |     at WebSocketServer.completeUpgrade (/build/app/node_modules/metro-inspector-proxy/node_modules/ws/lib/websocket-server.js:358:5)
expo_1  |     at WebSocketServer.handleUpgrade (/build/app/node_modules/metro-inspector-proxy/node_modules/ws/lib/websocket-server.js:271:10)
expo_1  |     at Server.<anonymous> (/build/app/node_modules/metro/src/index.js:229:40)
expo_1  |     at Server.emit (node:events:390:28)
expo_1  |     at onParserExecuteCommon (node:_http_server:727:14)
expo_1  |     at onParserExecute (node:_http_server:640:3)
expo_1  | /build/app/node_modules/metro-hermes-compiler/src/emhermesc.js:77
expo_1  |           throw ex;
expo_1  |           ^
expo_1  | 
expo_1  | RuntimeError: abort(TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Error). Build with -s ASSERTIONS=1 for more info.
expo_1  |     at process.abort (/build/app/node_modules/metro-hermes-compiler/src/emhermesc.js:402:15)
expo_1  |     at process.emit (node:events:402:35)
expo_1  |     at process.emit (/build/app/node_modules/xdl/node_modules/source-map-support/source-map-support.js:439:21)
expo_1  |     at emit (node:internal/process/promises:136:22)
expo_1  |     at processPromiseRejections (node:internal/process/promises:242:25)
expo_1  |     at processTicksAndRejections (node:internal/process/task_queues:97:32)
expo_1  | error Command failed with exit code 7.
expo_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
kinksters-react_expo_1 exited with code 7

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvatnecommented, Jun 24, 2022

this is also being tracked in https://github.com/facebook/flipper/issues/3549 - the source of the issue isn’t anything in the expo/expo repository as far as i can tell, it appears to be coming from hermes . I expect the websocket error is a red herring and the true exception is:

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Error ....
0reactions
github-actions[bot]commented, Dec 19, 2022

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

xuR - River Thames Conditions - Environment Agency - GOV.UK
Old school cell phones motorola, Crash drive 2 christmas cheats, Supporti tv da parete ... El escudo de dabeiba, News leader springfield mo...
Read more >
Untitled
Mcas miramar dental clinic phone number, Moksha hinduism pdf, Multivariate normal ... Erika tham facebook, Metro ourcq montparnasse, Pimpinan komisi dpr.
Read more >
react-native run-android build crashes on launch without red ...
... their build config and when we import it the compiler prevents debug features. That's why it can not get connected to the...
Read more >
failed to initialize react-native-reanimated library - You.com
❌ Metro encountered an error: Cannot read property 'transformFile' of undefined › Generating debug greengot » green-got.app.dSYM ⚠️ Pods/boost-for-react- ...
Read more >
mjsimodulepackage null - Tasavvuf Nedir?
This is the order they appear in the debug tab of Android Studio. Hermes JS ... But now i get error from metro...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found