jester icon indicating copy to clipboard operation
jester copied to clipboard

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

Open mawkler opened this issue 2 years ago • 11 comments

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.

mawkler avatar Jun 29 '22 07:06 mawkler

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

David-Kunz avatar Jun 29 '22 07:06 David-Kunz

@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 avatar Jun 30 '22 13:06 mawkler

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

mawkler avatar Jun 30 '22 14:06 mawkler

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: https://github.com/David-Kunz/jester/commit/5b66eb7ac3ed1cb9369cb7e556baef1fd48dc1b5

Best regards, David

David-Kunz avatar Jul 01 '22 09:07 David-Kunz

Ok, thank you!

mawkler avatar Jul 06 '22 11:07 mawkler

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

David-Kunz avatar Aug 27 '22 14:08 David-Kunz

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() :thinking:

mawkler avatar Aug 29 '22 09:08 mawkler

Thanks @melkster , I'll have a look.

David-Kunz avatar Aug 29 '22 10:08 David-Kunz

I have same issue.:-(

gxbsst avatar Jan 04 '23 03:01 gxbsst

I'm having this problem too.

dimas-cyriaco avatar Nov 15 '23 17:11 dimas-cyriaco

@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?

Hugobsb avatar Feb 01 '24 17:02 Hugobsb