-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Calling Eleventy constructor in test in ESM project #3028
Comments
According to this issue #836, I assume it's on the roadmap for 3.0.0? |
Possibly. Zac asked in Mastodon for a ticket. I don't mind this being marked as dupe. Perhaps the esbuild-register part is relevant. |
After a little research and cloning the repo, I think the only thing you need to do here is rename your Of course, 3.0 will bring ESM support to the So, good news! This test case is only education and not dependent on the 3.0 release. |
Unfortunately that leads to switching to CJS and:
I'm ok with leaving this closed and waiting for 3.0. |
What command are you using to run Eleventy? You aren’t removing the |
I should have mentioned: I'm running the tests. Thus: I think I'm screwed. 😉 It's ok for me to just wait for what you're doing. Can't wait for first alpha. |
Operating system
macOS Ventura 13.5.1
Eleventy
2.0.1
Describe the bug
I'm using 11ty+TS+TSX etc. via Vite/esbuild. In a Vitest tests, calling the
Eleventy
constructor fails in config becauserequireAbsolute
callsrequire
directly.Repo: https://github.com/pauleveritt/eleventy-vitest
The README has some instructions. The test file has a comment at the end with the traceback:
Reproduction steps
Clone the repo: https://github.com/pauleveritt/eleventy-vitest
npm install
npm run test
Expected behavior
No response
Reproduction URL
https://github.com/pauleveritt/eleventy-vitest
Screenshots
No response
The text was updated successfully, but these errors were encountered: