Skip to content
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

"No active session" when I run require"jester".debug() #17

Open
mawkler opened this issue Jun 29, 2022 · 11 comments
Open

"No active session" when I run require"jester".debug() #17

mawkler opened this issue Jun 29, 2022 · 11 comments

Comments

@mawkler
Copy link

mawkler commented Jun 29, 2022

Hi! When I run require"jester".debug() on a jest test I get the message "No active session". If I run require"jester".debug_file() nothing happens. Do you know what I could be doing wrong?

Here's a link to my dap/jester configuration.

@David-Kunz
Copy link
Owner

David-Kunz commented Jun 29, 2022

Hi @melkster ,

Thanks for reaching out to me. Unfortunately I'm not sure what the root cause is, but I can give you my own configuration:

dap.adapters.node2 = {
  type = 'executable',
  command = 'node',
  args = {os.getenv('HOME') .. '/apps/node/out/src/nodeDebug.js'}, -- adjust the path!
}

Could you kindly try it out with this config?

Thanks and best regards,
David

@mawkler
Copy link
Author

mawkler commented Jun 30, 2022

@David-Kunz I think I found the problem: the debugger tries to run ~/node_modules/.bin/jest even though my workspace, or Neovim's cwd isn't in my home directory. If I first navigate to the project's working directory and then open Neovim the correct Jest path is used. So is there a problem with how Jester computes Neovim's current working directory?

Now I also get another weird behaviour when using your config: After setting a breakpoint and doing require"jester".debug() I get the error message "Breakpoint ignored because generated code not found (source map problem?).", but after maybe one second DAP starts working and I see DAP stopping at my breakpoint as intended.

@mawkler
Copy link
Author

mawkler commented Jun 30, 2022

I'm guessing that the first problem is here since cwd only gets computed once when jester is loaded.

@David-Kunz
Copy link
Owner

David-Kunz commented Jul 1, 2022

Hi @melkster,

"Breakpoint ignored because generated code not found (source map problem?)."

Yes, I also get this warning sometimes (even though everything works). This seems to be a problem with nvim-dap, you can open an issue there if it bugs you too much.

since cwd only gets computed once when jester is loaded.

Oh thanks for the hint! I fixed it: 5b66eb7

Best regards,
David

@mawkler
Copy link
Author

mawkler commented Jul 6, 2022

Ok, thank you!

@David-Kunz
Copy link
Owner

Hi @melkster ,

I followed the discussion and saw that the default configuration seems to be wrong, I fixed that in the newest version of Jester.

Thanks for the report and best regards,
David

@mawkler
Copy link
Author

mawkler commented Aug 29, 2022

After updating, the error message seems to have changed to "Breakpoint set but not yet bound". Also, the "No active session" message still is printed when I do require('jester').debug() 🤔

@David-Kunz
Copy link
Owner

Thanks @melkster , I'll have a look.

@David-Kunz David-Kunz reopened this Aug 29, 2022
@gxbsst
Copy link

gxbsst commented Jan 4, 2023

I have same issue.:-(

@dimas-cyriaco
Copy link

I'm having this problem too.

@Hugobsb
Copy link

Hugobsb commented Feb 1, 2024

@David-Kunz @dimas-cyriaco @gxbsst hey! I hope you are doing well.

Removing the cwd option from dap config resolved the problem for me. Have you tried that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants