GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — esm: drop support for import assertions by nicolo-ribaudo · Pull Request #52104 · nodejs/node

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Mar 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description for changelog: #52104 (comment)


This patch removes support for the assert keyword for import attributes. It was an old variant of the proposal that was only shipped in V8 and no other
engine, and that has then been replaced by the with keyword.

Chrome is planning to remove support for assert
in version 126, which will be released in June.

Node.js already supports the with keyword for
import attributes, and this patch does not change that.

Fixes #51622

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss, melroy89, robpalme, Zearin, CloudBranch, showmeyourhits, and mkosir reacted with rocket emoji
All reactions
  • 🚀 7 reactions
@nodejs-github-bot

nodejs-github-bot commented Mar 15, 2024

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Mar 15, 2024
@aduh95

aduh95 commented Mar 15, 2024

Copy link
Copy Markdown
Contributor

Worth noting that v18.x does not support with syntax at all, so currently anyone trying to write code that uses import assertions/attributes has to use the older assert syntax to write code that works in all release lines. If/when this PR lands, there will be no way to write code that works everywhere. That being said, both syntaxes are experimental and therefore not subject to semver.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented Mar 15, 2024

Copy link
Copy Markdown
Member

Worth noting that v18.x does not support with syntax at all, so currently anyone trying to write code that uses import assertions/attributes has to use the older assert syntax to write code that works in all release lines. If/when this PR lands, there will be no way to write code that works everywhere. That being said, both syntaxes are experimental and therefore not subject to semver.

As I mentioned in #51622 (comment) I'm open to landing #51136 on v18.x.

nicolo-ribaudo and aduh95 reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nicolo-ribaudo
nicolo-ribaudo commented Mar 16, 2024
View reviewed changes
Comment thread test/es-module/test-esm-import-attributes-errors.js Outdated

@nicolo-ribaudo nicolo-ribaudo Mar 16, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently throws "unexpected token 'assert" -- I submitted a patch to V8 to make the error explicitly recommend to use 'with' instead: https://chromium-review.googlesource.com/c/v8/v8/+/5376260

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nicolo-ribaudo
esm: drop support for import assertions
4c227bd
This patch removes support for the `assert` keyword
for import attributes. It was an old variant of the
proposal that was only shipped in V8 and no other
engine, and that has then been replaced by the `with`
keyword.

Chrome is planning to remove support for `assert`
in version 126, which will be released in June.

Node.js already supports the `with` keyword for
import attributes, and this patch does not change that.
@nicolo-ribaudo
nicolo-ribaudo force-pushed the drop-assert branch from 462d735 to 4c227bd Compare March 16, 2024 11:07
mcollina
mcollina approved these changes Mar 18, 2024
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

melroy89 reacted with laugh emoji
All reactions
  • 😄 1 reaction
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Mar 18, 2024
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Mar 18, 2024
@nodejs-github-bot

nodejs-github-bot commented Mar 18, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/57802/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Apr 13, 2024
2024-04-24, Version 22.0.0 (Current) #52505
Merged
joyeecheung
joyeecheung approved these changes Apr 17, 2024
View reviewed changes
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Apr 17, 2024
@joyeecheung

joyeecheung commented Apr 17, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Since V8 will remove assert and it’s stage 3 going back to stage 2 and then broken in the spec anyway, is it semver major?(To me it looks more like experimental features and not subject to semver and @aduh95 also said something similar in #52104 (comment) ). It would not be great to continue having assert lingering around in v22 and then V8 breaks it and we cannot upgrade V8 on v22.

If it’s semver-major we should try getting it into v22 in time. Otherwise we can land it later on v22 (still nicer to have it in the beginning but I guess it’s not the end of the world to land it in 22.1.0 or something).

cc @targos @nodejs/releasers

nicolo-ribaudo reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Apr 17, 2024
@nodejs-github-bot

nodejs-github-bot commented Apr 17, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/58482/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

anonrig
anonrig approved these changes Apr 17, 2024
View reviewed changes
@nicolo-ribaudo

nicolo-ribaudo commented Apr 18, 2024

Copy link
Copy Markdown
Contributor Author

The CI failures don't seem related to my changes, but maybe I should try rebasing? Or could somebody re-trigger CI?

The arm build is failing both on windows and OSX.

For the test failures on Linux, one is a timeout and the other one is marked as flaky.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/58486/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Apr 18, 2024

Copy link
Copy Markdown
Member

@RafaelGSS this should be in v22

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo

nicolo-ribaudo commented Apr 18, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Now the macOS failure is a flaky test (not ok 1443 parallel/test-http-server-headers-timeout-keepalive # TODO : Fix flaky test at https://ci.nodejs.org/job/node-test-commit-osx-arm/16770/nodes=osx11/consoleFull).

The failure on linux is a timeout:

09:37:39 not ok 483 async-hooks/test-writewrap
09:37:39   ---
09:37:39   duration_ms: 120041.78500
09:37:39   severity: fail
09:37:39   exitcode: -15
09:37:39   stack: |-
09:37:39     timeout

(out of curiosity, when you have to re-run CI due to flaky tests, do you re-run everything or just the failed jobs?)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Apr 18, 2024

Copy link
Copy Markdown
Member

out of curiosity, when you have to re-run CI due to flaky tests, do you re-run everything or just the failed jobs?

When we use the "Resume build" button on Jenkins, it reruns all jobs that are either orange (only flaky failures) or red (at least one non-flaky failure).

nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/58488/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Apr 18, 2024

Copy link
Copy Markdown
Member

@targos it does not seem I can rerun the GHA.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Apr 18, 2024

Copy link
Copy Markdown
Member

It's probably too old to be re-runnable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo

nicolo-ribaudo commented Apr 18, 2024

Copy link
Copy Markdown
Contributor Author

Should I push an empty commit to retrigger it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Apr 18, 2024

Copy link
Copy Markdown
Member

let's see if the main CI passes first.

nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Apr 18, 2024

Copy link
Copy Markdown
Member

Please push a fresh commit.

nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pcorpet pcorpet mentioned this pull request Sep 22, 2024
Compatibility with Node v22 JesusTheHun/storybook-addon-remix-react-router#70
Closed
@tinykite tinykite mentioned this pull request Nov 8, 2024
Quire new command fails with newer version of Node thegetty/quire#968
Closed
1 task done
@gaoxiaoduan gaoxiaoduan mentioned this pull request Nov 12, 2024
创建docker报错,日志如下 gaoxiaoduan/YoutubeToBilibiliHelp#13
Closed
@aduh95 aduh95 mentioned this pull request Nov 16, 2024
doc: add history entry for import assertion removal #55883
Merged
nodejs-github-bot pushed a commit that referenced this pull request Nov 18, 2024
@aduh95
doc: add history entry for import assertion removal
a8daa45
PR-URL: #55883
Refs: #52104
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
@princed princed mentioned this pull request Nov 21, 2024
RudderTyper doesn't work on Node 22 rudderlabs/rudder-typer#86
Closed
aduh95 added a commit that referenced this pull request Nov 26, 2024
@aduh95
doc: add history entry for import assertion removal
f9d25ed
PR-URL: #55883
Refs: #52104
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
@gillisandrew gillisandrew mentioned this pull request Nov 28, 2024
SyntaxError: Unexpected identifier 'assert' in Node 22 LTS actions/languageservices#144
Closed
1 of 4 tasks
@Tofandel Tofandel mentioned this pull request Dec 6, 2024
Fix issues after latest updates ismail9k/vue3-carousel#440
Merged
aduh95 added a commit that referenced this pull request Dec 10, 2024
@aduh95
doc: add history entry for import assertion removal
8f91622
PR-URL: #55883
Refs: #52104
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
@akashrpo akashrpo mentioned this pull request Dec 13, 2024
fix: use with instead of assert as per latest node version rudderlabs/rudder-typer#95
Merged
buzz added a commit to buzz/imdb-link-em-all that referenced this pull request Dec 17, 2024
@buzz
drop support for import assertions
189fe69
nodejs/node#52104
ruyadorno pushed a commit that referenced this pull request Jan 5, 2025
@aduh95 @ruyadorno
doc: add history entry for import assertion removal
5bdfde8
PR-URL: #55883
Refs: #52104
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
@hejops hejops mentioned this pull request Feb 4, 2025
SyntaxError: Unexpected identifier 'assert' on build aknorw/discojs#69
Open
@inottn inottn mentioned this pull request Feb 17, 2025
fix(ci): use with instead of assert syntax vuejs/core#12901
Merged
@jpmcb jpmcb mentioned this pull request May 2, 2025
fix: Use "with" instead of "assert" in examples/custom-module/bundle.mjs zuplo/zuplo#46
Merged
@eucyt eucyt mentioned this pull request May 7, 2025
Update Node.js version requirement to v20.10 or later line/line-bot-mcp-server#58
Closed
@GeoffreyBooth GeoffreyBooth mentioned this pull request Apr 10, 2026
loader: add experimental text import #62300
Merged
@coderabbitai coderabbitai Bot mentioned this pull request May 2, 2026
refactor: ESmoduleにすべて統一。バージョンが古いと新しいバージョンありますと表示する機能を追加 otusoa/lism-ui-vue#26
Merged
@coderabbitai coderabbitai Bot mentioned this pull request May 12, 2026
feat: add deploy v1 runtime, schema, and examples AgentWorkforce/workforce#88
Closed
@sambbaron sambbaron mentioned this pull request May 20, 2026
Fix Node 22 import attribute syntax: assert -> with FunnelEnvy/activities-loader#123
Merged
4 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jun 18, 2026
refactor(cli): migrate off Bun runtime to Node flanksource/facet#44
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 5, 2026
fix(tokenizer): tiktoken's JSON imports need an import attribute under the bundle langwatch/langwatch#6592
Merged
This was referenced Aug 8, 2026
Import attributes don't survive the rollup builder: emitted with the removed assert key, and dropped in .ts sources on v2 nitrojs/nitro#4518
Closed
fix(rollup): keep import attributes in the build output nitrojs/nitro#4519
Merged
fix(rollup): emit import attributes with the with key nitrojs/nitro#4520
Merged
serverBundle.externalizeIconsJson ships assert { type: "json" }, so the icon API 500s on Node 22+ nuxt/icon#522
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 24, 2026
chore: migrate into modern tooling setup ueberdosis/hocuspocus#1142
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@RafaelGSS RafaelGSS RafaelGSS left review comments
@mcollina mcollina mcollina approved these changes
@GeoffreyBooth GeoffreyBooth GeoffreyBooth approved these changes
@anonrig anonrig anonrig approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@Ethan-Arrowood Ethan-Arrowood Ethan-Arrowood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Re-flag assert syntax for import attributes in Node.js 22

Uh oh!

There was an error while loading. Please reload this page.

12 participants

@nicolo-ribaudo @nodejs-github-bot @aduh95 @richardlau @joyeecheung @mcollina @targos @Dlyftservies @GeoffreyBooth @anonrig @Ethan-Arrowood @RafaelGSS
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.