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

Fix loading with Node.js v22.12.0 #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

osmestad
Copy link

@osmestad osmestad commented Dec 5, 2024

Hey!

As this package defines "type": "module" the contents of /preset.js is assumed to be a ESM module, but it contains CJS code. Switching the file type seems to resolve this.

Issue first reported here: nodejs/node#56127

This revert the commit: 7d3379b I'm not sure what the reasoning was for changing it back then? But with the latest Node release I think this is the way to go. Our build worked fine up to and including the previous Node version: 22.11.0 but is broken now.

As this package defines `"type": "module"` the contents of `/preset.js` is assumed to be a ESM module, but it contains CJS code. Switching the file type seems to resolve this.
@MehediH
Copy link

MehediH commented Dec 10, 2024

@valentinpalkovic would be awesome if we can get this fix released. we are running into the same issue in our project with node 22.12.0, thank you!

@valentinpalkovic valentinpalkovic added the patch Increment the patch version when merged label Dec 10, 2024
@valentinpalkovic
Copy link
Contributor

Hi @osmestad

Thank you for putting together this PR. I'll take a look.

@valentinpalkovic
Copy link
Contributor

Hi @osmestad

Can you please try out the following canary release:
3.0.4--canary.11.642a6d9.0

In #11 I've changed the package being CJS. I am not sure, whether your PR will break usage of the addon in pre Node.js v22 versions in some scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants