question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error attachToServer is not a function.

See original GitHub issue

Environment

System: OS: macOS 12.1 CPU: (8) x64 Intel® Core™ i7-7700K CPU @ 4.20GHz Memory: 68.83 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.12.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/bin/npm Watchman: 2022.01.03.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 28, 29, 30, 31, 32 Build Tools: 28.0.3, 29.0.2, 30.0.2, 31.0.0, 32.0.0 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64 Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8139111 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 15.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Description

Hello there, today I’m trying a new app, and I got this error. Any idea?

Thanks!

error attachToServer is not a function.
TypeError: attachToServer is not a function
    at Object.runServer [as func] (/Users/*******/Documents/Devs/*******/AppName/node_modules/@react-native-community/cli-plugin-metro/build/commands/start/runServer.js:131:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.handleAction (/Users/*******/Documents/Devs/*******/AppName/node_modules/@react-native-community/cli/build/index.js:192:9)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
thymikeecommented, Feb 18, 2022

The fix should be ready on npm: https://www.npmjs.com/package/@react-native-community/cli-server-api Please update the @react-native-community/cli to the 6.x version by invalidating the lock file.

7reactions
thymikeecommented, Feb 18, 2022

Published a breaking change to 6.x by mistake. Working on a fix right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native - error attachToServer is not a function
I was able to resolve the issue by installing @react-native-community/cli. npm i @react-native-community/cli --save-dev.
Read more >
Metro Server not starting: error attachToServer is not ... - GitHub
When I try to run npm start metro starts but now it is always crashing: error attachToServer is not a function I have...
Read more >
How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >
[Solved]-req.assert is not a function error-node.js
Kindly try by replacing assert with checkBody. req.checkBody('name', 'Name cannot be blank').notEmpty(). Do it like this. Syed Kashan Ali 591.
Read more >
Language Server Extension Guide - Visual Studio Code
You will see this timeout error if the server isn't running when you try to attach the debugger. The client starts the language...
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