Skip to content

error on node 25.2.0 #1649

@gavinthomas-valtech

Description

@gavinthomas-valtech

Describe the bug

There was a recent update to node (25.2.0)

nodejs/node#60351

The behavior of the global localStorage variable has changed, in the specific case when webstorage is enabled but the --localstorage-file option is not provided. In Node.js v25.0.0 and v25.1.0, this would cause localStorage to be initialized as an empty object. In v25.2.0, an exception is now thrown when the localStorage variable is accessed, which is more consistent with the web standard.

Which is now throwing in builds using 25.2.0

I get this kind of error

SecurityError: Cannot initialize local storage without a --localstorage-file path at Object.get [as localStorage] (node:internal/webstorage:28:17) at get localStorage (node:internal/util:660:20) at merge (/builds/development/ecommerce/webapplication/node_modules/eval/eval.js:11:13) at module.exports [as default] (/builds/development/ecommerce/webapplication/node_modules/eval/eval.js:42:5) at Object.processVanillaFile (/builds/development/ecommerce/webapplication/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.prod.js:145:50) at /builds/development/ecommerce/webapplication/node_modules/@vanilla-extract/webpack-plugin/loader/dist/vanilla-extract-webpack-plugin-loader.cjs.prod.js:67:38 at processTicksAndRejections (node:internal/process/task_queues:103:5) at runNextTicks (node:internal/process/task_queues:68:3) at process.processImmediate (node:internal/timers:472:9) Import trace for requested module:

Reproduction

s

System Info

Node: 25.2.0 - /Users/gavin.thomas/.nvm/versions/node/v25.2.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 11.6.2 - /Users/gavin.thomas/.nvm/versions/node/v25.2.0/bin/npm
    pnpm: 9.0.0 - /Users/gavin.thomas/.nvm/versions/node/v22.16.0/bin/pnpm

Used Package Manager

pnpm

Logs

SecurityError: Cannot initialize local storage without a --localstorage-file path at Object.get [as localStorage] (node:internal/webstorage:28:17) at get localStorage (node:internal/util:660:20) at merge (/builds/development/ecommerce/webapplication/node_modules/eval/eval.js:11:13) at module.exports [as default] (/builds/development/ecommerce/webapplication/node_modules/eval/eval.js:42:5) at Object.processVanillaFile (/builds/development/ecommerce/webapplication/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.prod.js:145:50) at /builds/development/ecommerce/webapplication/node_modules/@vanilla-extract/webpack-plugin/loader/dist/vanilla-extract-webpack-plugin-loader.cjs.prod.js:67:38 at processTicksAndRejections (node:internal/process/task_queues:103:5) at runNextTicks (node:internal/process/task_queues:68:3) at process.processImmediate (node:internal/timers:472:9) Import trace for requested module:

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions