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.

emulator throwing error MODULE_NOT_FOUND with --inspect-functions

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 8.4.3

Platform: mac os catalina 10.15.5 node -v v12.18.1

visual studio code Version: 1.46.1

[REQUIRED] Test case

  1. created new project with 1 firebase function “hello_word”

  2. when I have run “firebase emulators:start --only firestore,functions” al works perfect

  3. when I run “firebase emulators:start --only firestore,functions --inspect-functions” I’ve got error:


functions: Watching “/Users/username/Documents/Firebase/myproject/purchases/functions” for Cloud Functions…

internal/modules/cjs/loader.js:983 throw err; ^

Error: Cannot find module ‘/Users/username/Documents/Firebase/myproject/purchases/functions/–inspect=localhost:9229’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12) at internal/main/run_main_module.js:18:47 { code: ‘MODULE_NOT_FOUND’, requireStack: [] }


[REQUIRED] Steps to reproduce

run “firebase emulators:start --only firestore,functions --inspect-functions”

firebase-debug-without-inspect.log

firebase-debug-with-inspect.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
samtsterncommented, Oct 22, 2020

@abeisgoat investigated this, I’ll summarize what he told me.

It turns out this is only an issue with the standalone Firebase Tools binary (installed via curl) and not an issue with the npm install. So if this is essential to you, install firebase-tools via npm install -g firebase-tools and it should work.

The reason this does not work is because we use pkg to embed node inside the standalone binary. For security reasons this embedded node install blocks all Node debugging via the --inspect flag. We may be able to find a way around this, but it will be a pretty big change so it’s not likely to happen very soon.

1reaction
samtsterncommented, Oct 21, 2020

@quantuminformation your error message is not related to this issue:

>  Error listing users: FirebaseAuthError: //cloud.google.com/docs/authentication/. Raw server response: "{"error":{"code":403,"message":"Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the identitytoolkit.googleapis.com. We recommend configuring the 

That is https://github.com/firebase/firebase-tools/issues/1371

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: no module named Python Error [Fixed]
Sometimes, Python throws the ModuleNotFoundError afterward. What does this error ... Here are a few reasons why a module may not be found:....
Read more >
Troubleshoot Python errors in Azure Functions - Microsoft Learn
This error occurs when a Python function app fails to load a Python module. The root cause for this error is one of...
Read more >
Python - Module Not Found - Stack Overflow
All modules in Python have to have a certain directory structure. You can find details here. Create an empty file called __init__.py under...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Apps using the Database Inspector may crash when running on the Android 11 emulator, with an error like the following appearing in logcat:....
Read more >
Debugging - Expo Documentation
Learn about different techniques and tools available to debug your Expo project. ... error message in Google and Stack Overflow, it's likely you're...
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