Firebase emulator --inspect-functions throws unsupported warning - node.js

Somehow i managed to break something with my firebase emulator. It already worked in the past and i don´t know why its no longer working.
When calling
firebase emulators:start --inspect-functions
Everythings starts up as expected, but i get the warning
--inspect-functions only supported for Node.js runtimes.
When trying to attach the debugger in VS Code its visible in the CALL STACK for ~5 seconds an then disappears.
Also in the terminal i don´t get the "Debugger attached" message when starting.
Here is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Debug",
"restart": true,
"port": 9229
}
]
}
Does anyone have a idea why its not working?

As per the discussion from this githud thread , Issue must be with firebase-tools version. Downgrading to an older version (i.e v11.21.0) of firebase-tools will solve the issue.

Related

launch.json for azure core function version 3

I was working in the azure core tools version 2 and recently updated to version 3. Now I am not able to run any functions as it is showing error message "connect Econnrefused 127.0.0.1:9091".
Here is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
I am working on windows machine and using 1.6.1 azure functions versions.
Do I have to change something? I checked and this is common error and reinstalling the extensions should work?I tried all those. Do you think, I am missing anything ?
Please check if the below workarounds help to:
Approach 1:
Use Integrated terminal in the VS Code and then run the Azure Functions Python:
I will also get this issue most of the time and My working launch.json configuration will be like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current file",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Azure Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
Approach 2:
If the above approach gets the issue still, then try changing the port number and then run the Azure Functions Python.
Approach 3:
Instead of running the Azure Functions Python from the VS Code built-in Run Menu, try with the commands func host start in the integrated terminal like:
If that does not help you, please refer to this workaround given here which solves the specific error of Azure Function Python - Error Connection Refused.

VSCode Debug TypeScript files inside symlink project

I am having a super annoying problem, that started unexpected.
I have two NodeJS projects, and both projects uses TypeScript and they are symlinked. I usually debug by just attaching to the running process.
When debugging with VSCode, if I put a breakpoint in the projectA it work just fine, and the breakpoint is bonded to the actual TS file I want.
But then, I need call projectB from my projectA, and here the debugger goes directly to the projectA/node_modules/projectB/dist/**.js files, and shows that my TS files are breakpoint set but not yet bound.
This is kind of unexpected, since it was working before, and the debugger went directly to the projectA/node_modules/projectB/src/**.ts files.
I am not sure what happened, but I don't recall changing anything, and I also can't make it work again.
If I try debugging with WebStorm (attaching, just like I do with VSCode) it works just fine, this is only happening with VSCode.
I even tried to install VSCode Insiders, but no luck.
Node version: 14.16.1
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"runtimeArgs": ["--preserve-symlinks", "--preserve-symlinks-main"],
},
]
}
PS: Both projects has the sourceMaps: true defined in the tsconfig.json file

How to debug NextJS during the build phase

My nextJS app have a path with 50k plus pages.
Running with npm run dev it works fine, but during build it gives me an error TypeError: Cannot read property 'page' of undefined at exportPaths.filter.route
That is weird, because I know how many paths I am trying to do (56,427) and they are fine.
I would really like to see where I messed up, but I can't launch a debugger for build stage ending with 'Starting inspector' multiple messages.
I have tried other ways, but with no success.
Here is my config, which is pretty obsolete, but seems straightforward:
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
"env": {
"NODE_OPTIONS": "--inspect"
},
"args": ["build"],
"port": 9229,
"console": "integratedTerminal"
}
P.S. Debugging npm run dev works fine
P.P.S. trying to 'listen' to the debugger in VS Code and launching debugger from command line, like in here https://nextjs.org/docs/advanced-features/debugging gives me the same problems.

Azure Functions local HTTP trigger issue and solution

Just wanted to post the steps I took after running into the following error when trying to run an Azure Function HTTP Trigger locally in VS Code:
"[error] Incompatible Node.js version. The version you are using is v13.1.0,
but the runtime requires an LTS-covered major version. LTS-covered versions
have an even major version number (8.x, 10.x, etc.) as per
https://github.com/nodejs/Release#release-plan. For deployed code, change
WEBSITENODEDEFAULT_VERSION to '~10' in App Settings. Locally, install or
switch to a supported node version (make sure to quit and restart your code
editor to pick up the changes)."
(1.) install NVM. Instructions here: https://github.com/nvm-sh/nvm#installing-and-updating
(2.) install NVS. Instructions here: https://github.com/jasongin/nvs
(3.) in your VS code terminal, run:
nvs add 12.16.1
nvs use node/12.16.1/x64
(4.) edit your launch.json to the following:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 5555,
"preLaunchTask": "func: host start"
}
],
"node": {
"runtimeVersion": "12.16.1"
}
}
(5.) in your VS code terminal, run:
func start

How to debug Azure Functions Core Tools with VS Code debugger?

I'm locally developing a Node.js app with Azure Functions Core Tools. I would like to debug it with help of VS Code debugger, but I get this error:
Cannot connect to runtime process, timeout after 10000 ms - (reason:
Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:5858)
For debug option, I've chosen "Attach to JavaScript Functions". This option was there by default and I haven't created it.
Here is content of my launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to JavaScript Functions",
"type": "node",
"request": "attach",
"port": 5858,
"preLaunchTask": "runFunctionsHost"
}
]}
How can I fix this issue and make the debugging to work?
Surprisingly issue was resolved by itself. So I close this issue.

Resources