-
Notifications
You must be signed in to change notification settings - Fork 1k
Can't debug with firebase tools 6.10.0 in vs code due to unverified breakpoints #1360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information. |
@vincy261 this seems like an issue with VSCode and not firebase tools. I would try asking on channels like StackOverflow to get the support you need. |
HI @thechenky , i have tested debug with firebase-tools 6.3.0 and attach to process perfectly work. with 6.10.0 doesn't. Same VS code |
Thanks @vincy261. I think @abeisgoat knows more about this. The new emulator (in versions 6.9.0 and above) runs the functions in a separate process which probably needs to expose some more information to be debuggable. |
Hey @vincy261, can you provide a detailed step-by-step example of how to reproduce this? I have no familiarity with VS Code or how the debugging works, so I'll need something like...
I have no idea what's expected so I can't really help until I have that info. As Sam said, we did switch how we run functions, so it's expected that this could break. |
Hi @abeisgoat , sure i can, so:
import * as express from 'express';
import * as functions from 'firebase-functions';
const app = express();
app.head('/', (req, res) => res.sendStatus(204))
app.get('/timestamp', (req, res) => {
res.send(`${Date.now()}`);
})
export const testFunction = functions.https.onRequest(app);
console.log('started')
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
}
]
}
tsc
firebase serve --only functions
res.send(`${Date.now()}`); the breakpoint doesn't turn red but grey and it will say "unverified breakpoint" thus calling timestamp endpoint in the browser it won't stop on the line. instead repeat the test with [email protected] (or at least prior to 6.9.0) and it will work! |
Fantastic, thanks for the thorough and quick response, I'll take a look at this when I get some time and report back! |
So I've looked into this a bit and it seems like it's going to be tricky. If we changed how the emulator works to solve #1353 it would also make this easier, so this is an argument in favor of changing that system. |
when install [email protected] it gives warning sudo npm i -g [email protected]
If you're using the Emulator via the Firebase CLI, you can If you're upgrading @google-cloud/functions-emulator, these
If you have trouble after upgrading, try deleting the config
Then restart the emulator. You can also check for any renegade
|
@vincy261 so you are saying you are getting the connection up, but the breakpoints are not verified? I would love to see some documentation on how to set it up, maybe towards the chrome debugger as well. Not just VS code @sultanmyrza not sure why you are posting stuff about a deprecated library? |
as @jimmont mentioned on #517 I simply use Also, I've only tested in on HTTPS functions so far. |
@goleary hey, i followed the steps but that just opens the ndb window. debugging session doesn't start. are there any additional steps to follow? |
This has been implemented and will be included in the next release. |
@samtstern are there any documentation on this? |
Working on that! We should have the docs ready before the next release so
it will be clear how to use it.
…On Thu, Dec 12, 2019, 1:05 PM Snorre Lothar von Gohren Edwin < ***@***.***> wrote:
@samtstern <https://github.com/samtstern> are there any documentation on
this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1360?email_source=notifications&email_token=ACATB2QTBE33DXGTHWZ4N6LQYKRTFA5CNFSM4HSDFLEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGYBAWQ#issuecomment-565186650>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACATB2V7SNZ4E3MFZ5VRYDLQYKRTFANCNFSM4HSDFLEA>
.
|
@samtstern coolio, great work! |
@samtstern I upgraded to 7.10.0, updated the launch.json to
and tried attaching debugger to firebase emulators:start and also firebase functions:shell but issue remains the same: Am I missing something here? |
@JerryGoyal |
Version
Then you can attach the debugger to port 9229 (default) |
Perfect!
|
@johngboutros that's a good feature request and I could see a few ways of achieving it: a) Disable timeouts entirely in debug mode Would you mind filing a new issue to discuss? |
A bit of documentation about this would be really helpful on the Firebase site tutorials. Instead I needed to go into my My |
@otri A common point of confusion (which I agree needs better docs) is the overlap between |
After a good few hours of faffing about, I found this thread and have confirmed what @otri has described above. I have added a 'debug' entry to my functions/packages.json as i am not using TypeScript mine looks like this: VSCode's launch.json now looks like this; If I launch my application from the terminal in VSCode itself the debugger attaches automatically. Whilst this does not fix the issue using firebase serve it is a suitable work around (for some of us at least) for local development until this is resolved properly. |
@n3rden |
Going forward I appreciate, but at present that method doesn't seem to work with breakpoints. |
Hi Sam,
I think it would be really good to look at this as a developer stumbling
blocker and doing a number of things to improve the situation.
Firebase team could do this:
1) Provide a tip right at execution or via command help info for the
necessary steps to enable debugging.
2) update the help documentation online about how to rig up your vscode
launch.json for attach debugging.
3) link the command line help to online help so developer can jump to it.
Emulator usage is invariably linked to the need to debug. Why leave this
friction in place?
- Aaron
On Wed, Mar 25, 2020 at 21:14 Sam Stern ***@***.***> wrote:
@n3rden <https://github.com/n3rden> firebase serve will not be changed to
have this capability. You can serve both your hosting and functions code
using emulators:start and that is the preferred method going forward.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1360 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHYAQB3KDA7KLAFLLOFA3RJHYSVANCNFSM4HSDFLEA>
.
--
…_______________________
Aaron Hilton
Steampunk Digital
mobile: +81 80 3947 6874 <+818039476874>
skype: otristudios
facetime: [email protected]
Monocle 3D Portrait <https://goo.gl/w0JV66>
|
@n3rden if your breakpoints aren't working can you file a new issue? We will dig into it. |
At the risk of sounding stupid if functions are running on ✔ functions: functions emulator started at http://localhost:5002 |
@quantuminformation a local function would be at a URL like this: But a deployed function would be here: In the future please file new issues if you have new questions. |
Sure, thanks for clearing this up |
When trying to use "firebase emulators:start" it did not work. I notice two things:
|
|
I am locking this issue as it references a fixed bug and future developers should file new issues |
Uh oh!
There was an error while loading. Please reload this page.
[REQUIRED] Environment info
firebase-tools: 6.10.0
Platform:macOs, Windows
[REQUIRED] Test case
launching attach to debug from launch.json, breakpoint will result all unverified with no possibility to stop in
[REQUIRED] Steps to reproduce
simply run Attach by Process ID, and breakpoints will result in grey unverified.
[REQUIRED] Expected behavior
breakpoint must to remain red for stop in and debug
[REQUIRED] Actual behavior
breakpoint remain grey after debug launched
i'd like to add that i have tested debug with firebase-tools 6.3.0 and attach to process perfectly work. with 6.10.0 doesn't.
The text was updated successfully, but these errors were encountered: