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

Node debugger issue with 3.0.0-alpha.14 through 17 #3371

Closed
zachleat opened this issue Jul 18, 2024 · 6 comments
Closed

Node debugger issue with 3.0.0-alpha.14 through 17 #3371

zachleat opened this issue Jul 18, 2024 · 6 comments
Labels
bug: dependency A problem in one of Eleventy’s dependencies

Comments

@zachleat
Copy link
Member

@zachleat I think the fix for this issue (6b8e53e) broke a workflow:

Versions:

  • Node.js v20.15.1 (installed via nvm)
  • Eleventy 3.0.0-alpha.14 through 3.0.0-alpha.17
  • Google Chrome 126.0.6478.178

I try to use the Chrome DevTools for Node.js to profile my 11ty build with this command:

node --inspect-brk ./node_modules/.bin/eleventy

After connecting the debugger and resuming execution, the build hangs. When I manually pause the debugger, it's stuck here in 11ty code:

module.register("./EsmResolver.js", import.meta.url, {

Deeper into the stack, execution has stopped here:

https://github.com/nodejs/node/blob/a407d1f0b3669cc82c755700f0d500fb27cc39ea/lib/internal/modules/esm/hooks.js#L592

The stack at that point looks like

    at HooksProxy.waitForWorker (node:internal/modules/esm/hooks:592:9)
    at HooksProxy.makeSyncRequest (node:internal/modules/esm/hooks:666:10)
    at CustomizedModuleLoader.register (node:internal/modules/esm/loader:466:23)
    at ModuleLoader.register (node:internal/modules/esm/loader:331:33)
    at Function.register (node:internal/modules/esm/loader:615:35)
    at file:///home/noelle/dev/www/node_modules/@11ty/eleventy/src/Util/Require.js:17:9
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)

When I use Eleventy 3.0.0-alpha.13, the problem doesn't manifest and I can debug through the entire build without issue.

via @noelleleigh #3270 (comment)

@zachleat zachleat added the bug label Jul 18, 2024
@zachleat
Copy link
Member Author

I can confirm that it works in some versions of Node and some not:

  • Works in Node v20.14
  • Hangs in Node v20.15
  • Works in Node v22.1
  • Hangs in Node v22.2
  • Hangs in Node v22.3
  • Hangs in Node v22.4
  • Hangs in Node v22.5

@zachleat
Copy link
Member Author

Confirmed removing EsmResolver fixes the issue.

@zachleat
Copy link
Member Author

Unfortunately, this one looks out of my control. This independent MVP still fails with the same workflow:

node --inspect-brk ./registerer.js

import module from "node:module";

module.register("./empty-file.js");

console.log( "DONE!" );

Do you want to file this upstream at the Node repo or would you like me to?

@zachleat zachleat added bug: dependency A problem in one of Eleventy’s dependencies and removed bug labels Jul 19, 2024
zachleat added a commit that referenced this issue Jul 19, 2024
@zachleat
Copy link
Member Author

Until this is fixed upstream you can use the ELEVENTY_SKIP_ESM_RESOLVER environment variable in 3.0.0-alpha.18 or newer.

@noelleleigh
Copy link

Do you want to file this upstream at the Node repo or would you like me to?

You understand this problem better than I do, so you’re probably the one best equipped to file an issue.

Thanks for looking into it!

@zachleat
Copy link
Member Author

I can confirm that this bug was fixed in Node 22.7.0 and newer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: dependency A problem in one of Eleventy’s dependencies
Projects
None yet
Development

No branches or pull requests

2 participants