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

Can't run Parcel with NODE_OPTIONS set to --use-openssl-ca #6569

Open
6XGate opened this issue Jul 8, 2021 · 2 comments · May be fixed by #9373
Open

Can't run Parcel with NODE_OPTIONS set to --use-openssl-ca #6569

6XGate opened this issue Jul 8, 2021 · 2 comments · May be fixed by #9373

Comments

@6XGate
Copy link

6XGate commented Jul 8, 2021

🐛 bug report

Can't run Parcel commands when NODE_OPTIONS is set to --use-openssl-ca.

🎛 Configuration (.babelrc, package.json, cli command)

${PROJECT_DIR}/package.json

{
  "name": "bulma-playground",
  "version": "1.0.0",
  "description": "",
  "main": "dist/index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel serve ./src/index.html",
    "build": "parcel build ./src/index.html",
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "bulma": "^0.9.3",
    "parcel": "^2.0.0-beta.3.1"
  }
}

~/.npmrc

node-options=--use-openssl-ca

🤔 Expected Behavior

Parcel will build or serve the project without error.

😯 Current Behavior

One of two options:

  • Don't pass process.env to the env worker options. This is the default already per the Node documentation. When omitted, it prevents the Node Worker::Worker constructor from parsing the NODE_OPTIONS environment again allowing the worker to run.
  • Filter out NODE_OPTIONS since not all per-process options are valid for V8 isolate creation used for thread workers. This isn't really the best course since the prior option will more transparently propagate the environment to the worker.

🔦 Context

On development workstation, we trust an in-house certificate authority/CA on local web server containers to ensure HTTPS works as expected. Node will not connect to those servers without the OpenSSL CA trust, where this CA is trusted, being used. To enable this, we use the .npmrc file to set NODE_OPTIONS to --use-openssl-ca.

This bug would prevent anyone using Parcel when the OpenSSL CA trust is enabled via NODE_OPTIONS with the --use-openssl-ca.

💻 Code Sample

6XGate/bugs-parcel-with-openssl-failure

  1. Install everything npm install
  2. Try building with parcel npm run build
  3. Try running the test script node test.js
  4. Try running the test script via npm npm run testjs
  • Step 2 will fail.
  • Step 3 and 3 will work.

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-beta.3.1
Node 12.22.2
npm/Yarn 7.19.1
Operating System Ubnuntu/20.04
@dbk91
Copy link

dbk91 commented Mar 29, 2022

I'm experiencing this issue, as well. Is this being actively worked on?

@viceice
Copy link

viceice commented Nov 10, 2023

I've opened a PR to fix the issue 🙃

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

Successfully merging a pull request may close this issue.

4 participants