You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression 25.2.0 - Cannot initialize local storage without a --localstorage-file path #60704
Very often you need to run through all global variables, especial in tools like testing frameworks/bundlers/etc, so it should not throw an error when you touch this
Reacted by Rob Hogan, Falderian, Sébastien Lorber and koroliov
Very often you need to run through all global variables, especial in tools like testing frameworks/bundlers/etc, so it should not throw an error when you touch this
The core assumption that enumerating the global object should never raise an exception, or that it should be side-effect-free at all, is not a valid one. This action would already throw in Node.js >=19 in builds without crypto support, and can definitely throw in browser environments. (Indeed, it also throws in Node.js <=24 if experimental local storage is enabled.)
I would have preferred this change to land in a major release for sure.
Ditto, although it was technically an "unchange" – the specification-compliant throw-on-access behaviour existed in v24, albeit behind a flag.
@Renegade334 I am not against such changes, but this is definitely a breaking change for this release, as you can see many well-known packages are broken...
Reacted by René, Sébastien Lorber, Steven Luscher, Jason Marshall, kestrelbright, Falderian, raytan-ncl, Arthur Woimbée, Jisagi, Artoooooor and 3 more
@slorber Agreed, at least we need time to migrate, Node.js can output a warning and after resolving this problem in TC55 change this behavior in the next major release, so we will have time to refactor code and make releases
Rather than a pure reversion, the more useful approach for backing off this change (and one which would be consistent with the presence tests mentioned previously) would be to switch from option 2 to option 1 from #60303, ie. expose undefined rather than throwing. This should at least not re-introduce the previous break for actual storage consumers.
Reacted by Alexander Akait, Matteo Collina and Sébastien Lorber
It did. #60677 (comment). The Release WG discussed, and based on the change being deliberate and in an experimental feature we decided not to block the release.
As far as I understand, you may still keep this change as-is for v26, which means we are delaying the breakage. It gives us time to upgrade the existing problematic call sites.
Can you please help us migrate common patterns, such as cloning {...global}?
Activity
alexander-akait commentedon Nov 13, 2025
Code to reproduce:
Very often you need to run through all global variables, especial in tools like testing frameworks/bundlers/etc, so it should not throw an error when you touch this
slorber commentedon Nov 13, 2025
This also broke Docusaurus production builds: facebook/docusaurus#11545
The production build issue is caused by this npm "eval" lib we use (1m download, but legacy/archived and won't be patched): https://github.com/pierrec/node-eval/blob/master/eval.js
This also broke our dev server through html-webpack-plugin: jantimon/html-webpack-plugin#1880
Renegade334 commentedon Nov 13, 2025
The core assumption that enumerating the global object should never raise an exception, or that it should be side-effect-free at all, is not a valid one. This action would already throw in Node.js >=19 in builds without crypto support, and can definitely throw in browser environments. (Indeed, it also throws in Node.js <=24 if experimental local storage is enabled.)
Ditto, although it was technically an "unchange" – the specification-compliant throw-on-access behaviour existed in v24, albeit behind a flag.
alexander-akait commentedon Nov 13, 2025
@Renegade334 I am not against such changes, but this is definitely a breaking change for this release, as you can see many well-known packages are broken...
temporarily disable tests with latest node while it has a regression
aduh95 commentedon Nov 13, 2025
Consider passing
--no-experimental-webstorageas a flag or in yourNODE_OPTIONSto unblock yourself if you're not usinglocalStorage.Xe commentedon Nov 14, 2025
This bit us when building Docusaurus in Anubis
cjihrig commentedon Nov 14, 2025
Given the breakage, it seems like #60351 should be reverted and the less severe bug it addressed (#60303) can be revisited.
slorber commentedon Nov 14, 2025
Made my argument here to motivate a revert: #60351 (comment)
TLDR:
alexander-akait commentedon Nov 14, 2025
@slorber Agreed, at least we need time to migrate, Node.js can output a warning and after resolving this problem in TC55 change this behavior in the next major release, so we will have time to refactor code and make releases
Renegade334 commentedon Nov 14, 2025
Rather than a pure reversion, the more useful approach for backing off this change (and one which would be consistent with the presence tests mentioned previously) would be to switch from option 2 to option 1 from #60303, ie. expose
undefinedrather than throwing. This should at least not re-introduce the previous break for actual storage consumers.SimenB commentedon Nov 14, 2025
Do we know why CITGM didn't flag this?
richardlau commentedon Nov 14, 2025
It did. #60677 (comment). The Release WG discussed, and based on the change being deliberate and in an experimental feature we decided not to block the release.
10 remaining items
slorber commentedon Nov 17, 2025
Thanks for reverting the change!
As far as I understand, you may still keep this change as-is for v26, which means we are delaying the breakage. It gives us time to upgrade the existing problematic call sites.
Can you please help us migrate common patterns, such as cloning
{...global}?See also #60750 (comment)
Node 25.2.0 needs you to specify a place to store localstorage (#1019)
SimenB commentedon Nov 18, 2025
Just for reference - Jest's looping through all the globals would be replaced with #46558 if it's ever implemented
tests.yml: fix "SecurityError: Cannot initialize local storage"
Revert "lib: throw from localStorage getter on missing storage path"
Adding env variables. Check nodejs/node#60704
Re-enable CI on Node v25 (latest) (#1623)
fix: work around recent NodeJS 25.2 breakage nodejs/node#60704
fix(ui): disable experimental webstorage to prevent Node.js 25.2.0 Se…
fix(ui): disable experimental webstorage to prevent Node.js 25.2.0 Se…
fix(ui): disable experimental webstorage to prevent Node.js 25.2.0 Se…
Revert "lib: throw from localStorage getter on missing storage path"
Revert "lib: throw from localStorage getter on missing storage path"
chore(node): pin Node 24 LTS; drop NODE_OPTIONS workaround — topic-11
Update dependency node to v26