✗ firebase emulators:start --inspect-functions
Debugger listening on ws://127.0.0.1:56849/df25ac21-1fd9-4af6-8c8b-281d113d9647
For help, see: https://nodejs.org/en/docs/inspector
Error activating auto attach, please report to https://aka.ms/js-dbg-issue
i emulators: Starting emulators: functions, firestore, hosting
⚠ emulators: It seems that you are running multiple instances of the emulator suite for project [myproject]. This may result in unexpected behavior.
⚠ functions: You are running the functions emulator in debug mode (port=9229). This means that functions will execute in sequence rather than in parallel.
⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, pubsub
⚠ Your requested "node" version "10" doesn't match your global version "14"
⚠ firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠ firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
i firestore: Firestore Emulator logging to firestore-debug.log
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
i ui: Emulator UI logging to ui-debug.log
i functions: Watching "/Users/fredriccliver/Projects/[myproject]/functions" for Cloud Functions...
> Debugger listening on ws://localhost:9229/66cf42da-91f5-4f73-8a9e-69f13b83b215
> Debugger listening on ws://localhost:9229/66cf42da-91f5-4f73-8a9e-69f13b83b215
> Debugger listening on ws://localhost:9229/66cf42da-91f5-4f73-8a9e-69f13b83b215
> For help, see: https://nodejs.org/en/docs/inspector
> Error activating auto attach, please report to https://aka.ms/js-dbg-issue
My project is based on firebase and I'm using firebase emulator with --inspect-functions option.
But, the remote debugging connection has been broken whenever I modified a functions-side(backend) code.
Thanks for the report!
After you see this error, can you run the Developer: Toggle Developer Tools command and see if there are any errors in the Console in that window?
notebookServiceImpl.ts:286 Cannot register renderer for ms-python.python since it did not have an entrypoint. This is now required: https://github.com/microsoft/vscode/issues/102644
(anonymous) @ notebookServiceImpl.ts:286
_handle @ extensionsRegistry.ts:76
acceptUsers @ extensionsRegistry.ts:76
_handleExtensionPoint @ abstractExtensionService.ts:396
_doHandleExtensionPoints @ abstractExtensionService.ts:332
_startLocalExtensionHost @ extensionService.ts:588
_scanAndHandleExtensions @ extensionService.ts:549
console.ts:137 [Extension Host] (node:30657) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
localProcessExtensionHost.ts:252 Extension Host
localProcessExtensionHost.ts:252 Extension Host
Sorry, there is noting special error type message in the developer console.
And that time, the debugger pipe has been broken, but no error message was printed.
It would be not helpful and not appropriated in this issue board, but here is the screen recording.
recording
At the last couple of seconds of the video, I saved the source file, and the remote pipe has been broken.
Ok, thanks. I'll give the firebase emulator a try on my machine later today.
At the last couple of seconds of the video, I saved the source file, and the remote pipe has been broken.
It looks like you used the "attach to process" command, which will stop once the process is killed. Firebase probably restarts the Node.js process; you can automatically reconnect by creating a launch.json like
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Process",
"restart": true,
"port": 9229,
"skipFiles": [
"<node_internals>/**"
]
},
]
}
with restart: true, this will reconnect. Then, hit F5 to connect to the process.
With your advice, now I can see the message in the debug console.
Lost connection to debugee, reconnecting in 1000ms
Thank you, Connor. It reconnects now well.
I also got this error, looks like it's not being able to reconnect to the same port:
Error: listen EADDRINUSE: address already in use /var/folders/v8/4f13dddn1_j48ch83gqhr69xd0jr4d/T/node-cdp.33345-1.sock.deferred at Server.setupListenHandle [as _listen2] (net.js:1289:21) at listenInCluster (net.js:1354:12) at Server.listen (net.js:1453:5) at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/debug-auto-launch/dist/extension.js:1:4807 at new Promise (<anonymous>) at Object.enter (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/debug-auto-launch/dist/extension.js:1:4455) at processTicksAndRejections (internal/process/task_queues.js:94:5) at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/debug-auto-launch/dist/extension.js:1:5213
I'm just trying to run some Jasmine unit tests...
Thanks for the report.
For the moment you can avoid this by disabling auto attach (and use a launch config if you nee debugging). I'll look at this.
@yonifra I think that issue should be fixed in the upcoming release of vscode where we simplify connection/server handling logic. Please let me know if not.
@fredriccliver if you're still able to hit that error I'm made a commit that logs more information about what happens. Please try tomorrow's nightly build and share the output, which should be more detailed. Note that after updating you'll have to run your program/node _twice_ to get show the details, since it lazily updated the 'bootloader' script on the first run.
@connor4312 Thanks Conner, yes I checked your update. I will share the detailed error on here after the nightly build released, 5 PM PST, tomorrow.
@connor4312
Hm, sorry. I'm not sure whether I'd followed the right way to test your last commit.
https://youtu.be/h6t9l4uN19c
I've followed this instruction.
1. Open the extensions view (ctrl+shift+x) and search for @builtin @id:ms-vscode.js-debug
2. Right click on the JavaScript Debugger extension and Disable it.
3. Search for @id:ms-vscode.js-debug-nightly in the extensions view.
4. Install that extension.
And it doesn't work. (I cannot see more detailed log) And also same in vscode-insider version.
Hey, sorry should have clarified, I was looking for the error that showed up when you had auto attach on (e.g. when debug.javascript.autoAttachFilter is set to smart)
@connor4312 Thank you for giving me more detail 🙂
First time, even I've turned on the debug.javascript.autoAttachFilter but the debugger was not attached automatically. After some struggling trials with the other options, this option needs to be turned off, but it was true by default.
debug.javascript.usePreviewAutoAttach
And now this connection is maintaining with source modifications! 👍
https://youtu.be/B2_TVZOcgI8
I don't know whether this is expected behaviour by the developers or not...
additional after
After that testing above, I returned back to builtin js-debug extension not nightly one. And it is really working as well never the same before. I cannot find the previous error message "> Error activating auto attach, please report to https://aka.ms/js-dbg-issue" anymore
(but in here, debug.javascript.usePreviewAutoAttach is true as same with default, not false)
, this option needs to be turned off, but it was true by default.
That option will go away next month. Please let me know what problems you hit when it was "true"
js-debug version : Nightly
debug.javascript.usePreviewAutoAttach : true (default)
does auto attach worked? : No
<2nd approach>
js-debug version : Nightly
debug.javascript.usePreviewAutoAttach : false (I've changed)
does auto attach worked? : Yes
<3rd approach>
js-debug version : Not Nightly, built in production one
debug.javascript.usePreviewAutoAttach : true (I've turned to default)
does auto attach worked? : Yes (Not make sense, it had not worked before)
As I said, there is no same error, and I couldn't find a helpful log message. And it is easy to guess it cannot be supported to solve this issue. I wanted to help you so, I carefully tested to send a log to you. But in this case, I just can say, that option(usePreviewAutoAttach) changing could have been another trigger.
There is no error message now, and the same environment(I guess) with the first time when I opened this issue.
But, now it is working. So I don't have any clue.
Okay, thank you for the info! I will go ahead and close this since you're no longer hitting any issues. If you (or anyone else) hits this again, then there should be a more useful error message for us to go on.
Thanks again for you help and willingness in debugging this.
I fixed one case I happened to run into on OSX https://github.com/microsoft/vscode/commit/c17be0166314d1f83fd10eff380bfe36eca02e56
If this was the issue you were running into, it would also have 'solved itself' at some point when the OS cleared your temp directory.
With the last VSCode delivery, this issue was totally resolved.
Most helpful comment
With the last VSCode delivery, this issue was totally resolved.