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

How do you debug the macros? #1040

Closed
NullVoxPopuli opened this issue Dec 7, 2021 · 9 comments
Closed

How do you debug the macros? #1040

NullVoxPopuli opened this issue Dec 7, 2021 · 9 comments

Comments

@NullVoxPopuli
Copy link
Collaborator

I was reading: https://github.com/embroider-build/embroider/blob/master/CONTRIBUTING.md
and I had tried:

JOBS=1 NODE_OPTIONS="--inspect-brk" ember s

with a debugger in the dependency-satisifies file (in node modules, js, compiled), but it seems babel ran in another thread.

How do you debug that part of that build?

@ef4
Copy link
Contributor

ef4 commented Dec 20, 2021

This is the right instructions, but probably you were hitting the persistent babel cache so the code was not being run.

You can rm -rf $TMPDIR/embroider first to eliminate the cache.

@ef4 ef4 closed this as completed Dec 20, 2021
@NullVoxPopuli
Copy link
Collaborator Author

Trying to get a debugger going now to see what's going on with: #1066
but,

using:

 rm -rf /tmp/embroider/ && JOBS=1 NODE_OPTIONS="--inspect-brk" ember s

even though nothing is running on this port before I run the command, I get this error upon starting:

Starting inspector on 127.0.0.1:9229 failed: address already in use

so... trying with

❯ rm -rf /tmp/embroider/ && JOBS=1 NODE_OPTIONS="--inspect-brk=0.0.0.0:9000" ember s

still gets a similar error:

Starting inspector on 0.0.0.0:9000 failed: address already in use

So, I think JOBS=1 maybe is insufficient?

maybe there is another way to single-thread or maybe a way to spawn multiple debuggers?

@ef4
Copy link
Contributor

ef4 commented Jan 10, 2022

If you debug with vscode this is all very automatic. The instructions I use are:

  1. Launch a "Javascript debug terminal".
  2. Run "ember s" in that terminal.

That's it. It doesn't even need JOBS because it follows child processes correctly.

@NullVoxPopuli
Copy link
Collaborator Author

NullVoxPopuli commented Jan 10, 2022

that sounds awesome and easy and I wish neovim had something that did that -- I may use that for all ember debugging if I can get this working.

I'm still somehow unable to hit my breakpoints in dependency-satisfies.js 🤔

Anything look out of the ordinary to you?
(I deleted /tmp/embroider first)
image

@ef4
Copy link
Contributor

ef4 commented Jan 10, 2022

That looks correct. Did you also remove the cache? That is still a potential blocker.

@NullVoxPopuli
Copy link
Collaborator Author

Did you also remove the cache?

at /tmp/embroider, yea 😢

@NullVoxPopuli
Copy link
Collaborator Author

Got this to work on my personal machine with local ember, rather than the globally installed one. ../node_modules/.bin/ember

@roomman
Copy link

roomman commented Mar 22, 2022

That's it. It doesn't even need JOBS because it follows child processes correctly.

How I wish this statement was true. Spent the day trying to get a breakpoint to bind in VSCode, to try ascertain why @ember/render-modifiers is causing glimmer to throwing Error: Invalid modifier manager compatibility specified... again! 2022 has not been kind so far 🤣

I've tried ember s and ./node_modules/ember-cli/bin/ember s in a Javascript debug terminal, several variations of launch and attach configurations, dredged up from forums and none of it works for me.

@NullVoxPopuli can you share your setup for this please?

@ef4
Copy link
Contributor

ef4 commented Mar 27, 2022

Nine times out of ten, when people have a problem with dependencySatisfies it's because dependencySatisfies is faithfully reporting that NPM or yarn have given them an invalid node_modules structure.

cd into the copy of render-modifiers that is failing and run node -e 'console.log(require.resolve("ember-source/package.json"))'. That will tell you which copy of ember-source, if any, render-modifiers is seeing.

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

3 participants