Skip to content

fix(ext/node): assert compatibility#31821

Merged
Tango992 merged 17 commits intodenoland:mainfrom
Tango992:fix-node-assert
Jan 17, 2026
Merged

fix(ext/node): assert compatibility#31821
Tango992 merged 17 commits intodenoland:mainfrom
Tango992:fix-node-assert

Conversation

@Tango992
Copy link
Copy Markdown
Contributor

@Tango992 Tango992 commented Jan 12, 2026

Implements the node:assert module based on Node.js v24.12.0, except for the lib/internal/assert/utils.js which requires resolving the error source location based on the source map. This PR removes the compatibility layer with Deno's @std/assert.

It enables the following node compatibility tests to pass:

@Tango992 Tango992 added the ci-draft Run the CI on draft PRs. label Jan 13, 2026
Comment on lines +55 to +58
let process: NodeJS.Process;
const lazyLoadProcess = core.createLazyLoader<NodeJS.Process>(
"node:process",
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some imports were changed like this to avoid crashing upon build with

Failed to initialize JsRuntime for snapshotting: CoreError(Js(JsError { name: Some("ReferenceError"), message: Some("Cannot access 'process' before initialization"), stack: None, cause: None, exception_message: "Uncaught ReferenceError: Cannot access 'process' before initialization", frames: [], source_line: None, source_line_frame_index: None, aggregated: None, additional_properties: [] }))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a bit unfortunate, but a good solution to the problem 👍

@Tango992 Tango992 marked this pull request as ready for review January 16, 2026 11:29
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice 👍 it looks like there are still a few test files that are now enabled, let's aim to do that in a separate PR

Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, nice work

@Tango992 Tango992 merged commit 021b3b9 into denoland:main Jan 17, 2026
19 checks passed
@Tango992 Tango992 deleted the fix-node-assert branch January 17, 2026 09:34
@ChALkeR
Copy link
Copy Markdown

ChALkeR commented Jan 23, 2026

This caused regressions: #31931

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run the CI on draft PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants