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

importAssertions is deprecated from node 22.12 #172

Open
bareketsarusi opened this issue Dec 19, 2024 · 0 comments
Open

importAssertions is deprecated from node 22.12 #172

bareketsarusi opened this issue Dec 19, 2024 · 0 comments

Comments

@bareketsarusi
Copy link

Starting from the latest node version (22.12) the use of importAssertions is deprecated.
You already have related to this deprecation in hook.js, but since you still use it, node still outputs a warning for using it.

The relevant code:

// Node.js v21 renames importAssertions to importAttributes
    if (
      (context.importAssertions && context.importAssertions.type === 'json') ||
      (context.importAttributes && context.importAttributes.type === 'json')
    ) {
      return result
    }

The warning that node outputs:

(node:22772) ExperimentalWarning: Use `importAttributes` instead of `importAssertions`
    (Use `node --trace-warnings ...` to show where the warning was created)

The implications of it are that the warning seems intimidating and it is uncontrollably verbose, only because I used import-in-the-middle as a third party package. I would love for a follow up 😄

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

No branches or pull requests

1 participant