GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — module: report unreadable package.json by bitpshr · Pull Request #65223 · nodejs/node Conversation
Contributor
Fixes #65220. A Two alternatives if you'd prefer them: warn and keep resolving, or restrict the new error to the direct package lookup and stay silent while walking up for the nearest parent config. That second one matters if anyone relies on resolution succeeding past an unreadable Fixes: #65220
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
bitpshr
force-pushed
the
module/unreadable-package-json
branch
from
b4271b7 to
e3bd440
Compare
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #65223 +/- ## ========================================== + Coverage 90.15% 90.32% +0.17% ========================================== Files 744 751 +7 Lines 242517 249656 +7139 Branches 45688 47178 +1490 ========================================== + Hits 218642 225505 +6863 - Misses 15358 15535 +177 - Partials 8517 8616 +99
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Checked the commit before the resolver moved to C++ (f13dbfd, parent 4ec085b). The JS So the silent fallback looks like it predates the C++ move rather than being a regression from it, which fits there never being coverage. Happy to be wrong if you remember an earlier version that threw, I only went back as far as the refactor. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: nodejs#65220 Signed-off-by: Paul Bouchon <[email protected]>
e3bd440 to
3957a8d
Compare
|
Applied both, thanks. The status assertions come last now, and the final |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in c4cfa63 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65223 Reviewed-By: Antoine du Hamel <[email protected]>
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65223 Reviewed-By: Antoine du Hamel <[email protected]>
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65223 Reviewed-By: Antoine du Hamel <[email protected]>
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65223 Reviewed-By: Antoine du Hamel <[email protected]>
A package.json that exists but cannot be read was treated the same as one that is not there: the read failure returned no config and resolution continued as if the package had none. Fields such as "exports" and "type" silently disappear, so a specifier can resolve to a different file than the package declares, while an unparsable package.json already throws ERR_INVALID_PACKAGE_CONFIG. Keep treating ENOENT and ENOTDIR as "no package config here", and report any other read failure with the underlying error. Fixes: #65220 Signed-off-by: Paul Bouchon <[email protected]> PR-URL: #65223 Reviewed-By: Antoine du Hamel <[email protected]>
Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]>
Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]>
Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]>
Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]>
* chore: bump node in DEPS to v24.21.0 * fix(patch): module: report unreadable package.json Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]> * chore: remove upstreamed patch * chore: update patches (trivial only) * fix(patch): skip OpenSSL default-config test with BoringSSL Ref: nodejs/node#64949 Co-Authored-By: Claude <[email protected]> * fix(patch): permission: enforce addon permission in GetLinkedBinding Upstream now throws ERR_ACCESS_DENIED from process._linkedBinding() when the permission model is enabled without --allow-addons. Electron's own bootstrap reaches all of its built-in modules through linked bindings, so `electron --permission` under ELECTRON_RUN_AS_NODE could no longer initialise Electron's Node.js integration. Add a patch exempting the electron_* bindings from the addon check; process.dlopen() and any other linked-binding name keep the upstream behaviour. Ref: nodejs/node#65432 Co-Authored-By: Claude <[email protected]> * chore: update filenames.auto.gni --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Sam Attard <[email protected]> Co-authored-by: Claude <[email protected]>
* chore: bump node in DEPS to v24.21.0 * fix(patch): module: report unreadable package.json Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]> * chore: update patches (trivial only) * fix(patch): skip OpenSSL default-config test with BoringSSL Ref: nodejs/node#64949 Co-Authored-By: Claude <[email protected]> * fix(patch): permission: enforce addon permission in GetLinkedBinding Upstream now throws ERR_ACCESS_DENIED from process._linkedBinding() when the permission model is enabled without --allow-addons. Electron's own bootstrap reaches all of its built-in modules through linked bindings, so `electron --permission` under ELECTRON_RUN_AS_NODE could no longer initialise Electron's Node.js integration. Add a patch exempting the electron_* bindings from the addon check; process.dlopen() and any other linked-binding name keep the upstream behaviour. Ref: nodejs/node#65432 Co-Authored-By: Claude <[email protected]> * chore: update filenames.auto.gni --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Sam Attard <[email protected]> Co-authored-by: Claude <[email protected]>
* chore: bump node in DEPS to v24.21.0 * fix(patch): module: report unreadable package.json Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]> * chore: update patches (trivial only) * fix(patch): skip OpenSSL default-config test with BoringSSL Ref: nodejs/node#64949 Co-Authored-By: Claude <[email protected]> * fix(patch): permission: enforce addon permission in GetLinkedBinding Upstream now throws ERR_ACCESS_DENIED from process._linkedBinding() when the permission model is enabled without --allow-addons. Electron's own bootstrap reaches all of its built-in modules through linked bindings, so `electron --permission` under ELECTRON_RUN_AS_NODE could no longer initialise Electron's Node.js integration. Add a patch exempting the electron_* bindings from the addon check; process.dlopen() and any other linked-binding name keep the upstream behaviour. Ref: nodejs/node#65432 Co-Authored-By: Claude <[email protected]> * chore: update filenames.auto.gni --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Sam Attard <[email protected]> Co-authored-by: Claude <[email protected]>
* chore: bump node in DEPS to v24.21.0 * fix(patch): module: report unreadable package.json Upstream now keeps the ReadFileSync error code and throws ERR_INVALID_PACKAGE_CONFIG for anything other than ENOENT/ENOTDIR/EISDIR. Route the ASAR override through the same read_error path and report a missing archive entry as UV_ENOENT so it is still negatively cached rather than surfaced as a read failure. Ref: nodejs/node#65223 Co-Authored-By: Claude <[email protected]> * chore: remove upstreamed patch * chore: update patches (trivial only) * fix(patch): skip OpenSSL default-config test with BoringSSL Ref: nodejs/node#64949 Co-Authored-By: Claude <[email protected]> * fix(patch): permission: enforce addon permission in GetLinkedBinding Upstream now throws ERR_ACCESS_DENIED from process._linkedBinding() when the permission model is enabled without --allow-addons. Electron's own bootstrap reaches all of its built-in modules through linked bindings, so `electron --permission` under ELECTRON_RUN_AS_NODE could no longer initialise Electron's Node.js integration. Add a patch exempting the electron_* bindings from the addon check; process.dlopen() and any other linked-binding name keep the upstream behaviour. Ref: nodejs/node#65432 Co-Authored-By: Claude <[email protected]> * chore: update filenames.auto.gni --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Sam Attard <[email protected]> Co-authored-by: Claude <[email protected]>
…4.21+ and 26.8+ alone (#202) The differential against Node's own resolver (#201) expected Node to refuse a package.json it can't read (a link loop, a loop through directories) with ERR_INVALID_PACKAGE_CONFIG. Node does so since 24.21.0 and 26.8.0 (nodejs/node#65223, "module: report unreadable package.json"); before, it took one for none and resolved past it. CI runs the engines floor, 24.14.0, and 26.0.0 too, where the test failed. The test now checks Node's answer against its two known behaviors by version, keeps the differential where every Node agrees (a link to nothing is none), and asserts ours refuses on every Node, as before. Claude-Session: https://claude.ai/code/session_01GGr7zsXxPPC6Mrmtn7qyJG Co-authored-by: Claude Fable 5.1 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
ESM resolver treats an unreadable package.json as absent:exports silently vanish and the wrong file can load
There was an error while loading. Please reload this page.