-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Upgrading from 11.0.2 -> 12.0.0: ReferenceError: __dirname is not defined #1069
Comments
Downgrading again fixes the error. |
I am having the same issue. |
Same issue. Not urgent for me but if it helps to debug: belgattitude/nextjs-monorepo-example#4377
Worth to mention that this project runs with "type": "module" (in esm). That might explain Keep the good work. 1000's thx btw. |
However, with the just released v12 a new file using public static getHappyDOMVersion(): string {
const content = FS.readFileSync(Path.join(__dirname, '..', '..', 'package.json')).toString();
|
…02-1200-referenceerror-__dirname-is-not-defined #1069@trivial: Fixes __dirname not defined error when using ESM.
Thank you @dflock, @ekwoka, @belgattitude and @tobua for reporting! 🙂 Big thanks to @ekwoka for collaborating on a fix! ⭐ The problem has been fixed now. You can read more about the release here: |
Describe the bug
My vitest tests run fine using happy-dom 11.0.2. After upgrading to 12.0.0, I get this for every test suite:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tests to run fine, as before.
Screenshots
If applicable, add screenshots to help explain your problem.
Device:
Additional context
Am using these versions of relevant packages:
The text was updated successfully, but these errors were encountered: