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

Eleventy 3.0.0 is using @11ty/dependency-tree #3593

Open
RogierKonings opened this issue Dec 16, 2024 · 4 comments
Open

Eleventy 3.0.0 is using @11ty/dependency-tree #3593

RogierKonings opened this issue Dec 16, 2024 · 4 comments

Comments

@RogierKonings
Copy link

RogierKonings commented Dec 16, 2024

Operating system

Windows 10

Eleventy

3.0.0

Describe the bug

There seem to be packages that still depend on CommonJS packages

Reproduction steps

  1. Install 11ty 3.0.0 version
  2. Convert project to use ESM module resolution
  3. Run an npx @11ty/eleventy --watch
  4. See the following warning

(node:12456) ExperimentalWarning: CommonJS module C:\…\node_modules\@11ty\dependency-tree\main.js is loading ES Module C:\…\site\.eleventy.js using require(). Support for loading ES Module in require() is an experimental feature and might change at any time

Expected behavior

I expect for 11ty 3.0.0 to use the ESM version: dependency-tree-esm

Reproduction URL

No response

Screenshots

No response

@zachleat
Copy link
Member

zachleat commented Dec 16, 2024

We use both @11ty/dependency-tree and @11ty/dependency-tree-esm internally but that’s unlikely to be the root of your error. Are you missing "type": "module" in your package.json?

@smorimoto
Copy link

I think the build works, but the watch didn't. Anyway, I hope you will release 3.0.1-alpha.1 to npm.

@zachleat
Copy link
Member

We have some CommonJS/ESM detection in Eleventy (which might be buggy?)—but I can’t determine without an answer to whether or not "type": "module" is in your package.json file

@RogierKonings
Copy link
Author

RogierKonings commented Dec 19, 2024

@zachleat "type": "module" is in my package.json. I think @smorimoto is onto something. I experience the error only on a --watch

The issue arise with node v22.10.0 and lower. In v23.3.0 no issues

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

No branches or pull requests

3 participants