Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "--use-openssl-ca is not allowed in NODE_OPTIONS" after upgrade 1.15.2->1.18.0 #9989

Open
pboguslawski opened this issue May 19, 2023 · 3 comments

Comments

@pboguslawski
Copy link

Describe the bug

Project that compiles fine with @sveltejs/kit 1.15.2 and

NODE_OPTIONS=--use-openssl-ca

present in environment (required for custom npm package registry to work), after upgrading kit to 1.18.0 with

npm update --save @sveltejs/kit

throws an error

[vite-plugin-sveltekit-compile] Initiated Worker with invalid NODE_OPTIONS env variable: --use-openssl-ca is not allowed in NODE_OPTIONS
✓ built in 8.82s
error during build:
Error [PLUGIN_ERROR]: Initiated Worker with invalid NODE_OPTIONS env variable: --use-openssl-ca is not allowed in NODE_OPTIONS
    at new NodeError (node:internal/errors:387:5)
    at new Worker (node:internal/worker:198:13)
    at file:///my/project/node_modules/@sveltejs/kit/src/utils/fork.js:37:19
    at new Promise (<anonymous>)
    at fn (file:///my/project/node_modules/@sveltejs/kit/src/utils/fork.js:36:10)
    at Object.handler (file:///my/project/node_modules/@sveltejs/kit/src/exports/vite/index.js:676:28)
    at file:///my/project/node_modules/rollup/dist/es/shared/node-entry.js:24395:40
    at async PluginDriver.hookParallel (file:///my/project/node_modules/rollup/dist/es/shared/node-entry.js:24317:17)
    at async file:///my/project/node_modules/rollup/dist/es/shared/node-entry.js:25678:13
    at async catchUnfinishedHookActions (file:///my/project/node_modules/rollup/dist/es/shared/node-entry.js:24758:20)

on compilation.

Attached diff of files changed with update as above.
kit_update.zip

Reproduction

As above.

Logs

No response

System Info

Checked in Debian 10 & 11 with
    Node: 16.20.0 - /usr/bin/node
    npm: 8.19.4 - /usr/bin/npm

Severity

blocking an upgrade

Additional Information

No response

@gregroyal
Copy link

I'm running into this too, any updates or workarounds?

@pboguslawski
Copy link
Author

pboguslawski commented Jan 18, 2024

Just tested that this problem does not occur in 1.16.3 but occurs in 1.17.0.

Maybe switch from child processes to workers in 2e6da94 requires also to adjust environment variable NODE_OPTIONS as error message says?

Similar problems:

@pboguslawski
Copy link
Author

Checked, that applying reverted https://github.com/sveltejs/kit/pull/9919/files over v1.17.0 resolves the issue. This confirms that problem was introduced in https://github.com/sveltejs/kit/pull/9919/files

Dirty workaround that works for us is to unset NODE_OPTIONS environment variable only for npm run build / npm run dev and leave it for other npm commands (i.e. install / update).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants