Fail fast with a clear error on unsupported Node.js and remove hard-coded node#135
Merged
krassowski merged 6 commits intoJul 3, 2026
Merged
Conversation
krassowski
reviewed
Jun 27, 2026
krassowski
left a comment
Member
There was a problem hiding this comment.
Looks good, just a suggestion on the error message
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the build experience when users run jupyter-builder with an unsupported Node.js version by checking the local Node.js version against @rspack/core’s engines.node requirement and failing early with a clear, actionable error message (instead of a later ERR_REQUIRE_ESM failure).
Changes:
- Add
_read_rspack_node_range()and_check_node_version()and call the check before spawning the builder in bothbuild_labextension()andwatch_labextension(). - Add tests covering reading
@rspack/core’s Node range and the version-check pass/fail behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
jupyter_builder/federated_extensions.py |
Adds Node version range discovery + fail-fast validation before running the JS builder. |
tests/test_core_path.py |
Adds unit tests for reading @rspack/core Node engine range and enforcing it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #127
Description
@rspack/core v2is ESM-only and requires Node>=20.19or>=22.12. On older Node versions, the build previously failed with a crypticERR_REQUIRE_ESMerror. Now we check the current Node version against rspack's ownengines.noderequirement before spawning Node and raise a clear, actionable error instructing users to upgrade.