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

"Most NODE_OPTIONs are not supported in packaged apps" when using yarn pnp #19229

Open
TheDutchCoder opened this issue Dec 3, 2021 · 36 comments
Labels

Comments

@TheDutchCoder
Copy link

Current behavior

When I run npm run cypress:open-ct (or run-ct), I get an error [43901:1203/085557.424470:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

This might be an Electron issue and it doesn't seem to affect behaviour for us.

Desired behavior

No error to be thrown

Test code to reproduce

Run the Cypress component tester

Cypress Version

9.1.0

Other

MacOS 11.6
Node v16.0.0

@eqje
Copy link

eqje commented Dec 9, 2021

Hi @TheDutchCoder We have same problem actually - did you solve this already?

@TheDutchCoder
Copy link
Author

It's still showing up, but I'm not sure if there's a newer version, will check that later.

We also get an "app quit unexpectedly" warning whenever we close Cypress.

@dfdumaresq
Copy link

dfdumaresq commented Dec 21, 2021

Same for me.

Cypress Version

  • Cypress 9.1.1.

Other

  • MacOS 11.6
  • Node v14.17.3

Running under VSCode.

  • Version: 1.63.0 (Universal)

@Karine-Bauch
Copy link

Same for me too

Ubuntu (virtualBox)
VS CODE

@russellpekala
Copy link

russellpekala commented Jan 13, 2022

Same here.

Cypress 9.2.1
Mac M1 latest

It seems to have affected cypress testing only on first open after clean install for me.

@dfdumaresq
Copy link

From my limited experience it doesn't seem to affect Cypress testing.

@mjhenkes mjhenkes added type: bug stage: ready for work The issue is reproducible and in scope labels Jan 14, 2022
@zigang93
Copy link

I am using yarn pnp .. encounter this issue

@riboher
Copy link

riboher commented Jan 24, 2022

Same thing as @zigang93. Using yarn PnP, all of a sudden I can't init cypress whatsoever. Trying to open the desktop app is unsuccessful, seeing the same error discussed above. When running my tests in headless mode, cypress starts, but it is like no packages have been installed at all, so everything fails.

@geoyws
Copy link

geoyws commented Jan 27, 2022

I have the same error messages but everything still runs.

@dbubenheim
Copy link

Same here. Log statements are showing up, but still the test suite runs fine.

@linediconsine
Copy link

I had the same warning

revert to cypress 9.2.0 seem to solve this,

npm install [email protected]

@giorgio-zamparelli
Copy link

For me downgrading to cypress 9.2.0 did not remove the error. Tests are still passing with both 9.2.0 and 9.5.1 with the error.

@ericblade
Copy link

9.5.1 reports this to me every time i run it. The first time, it crashed immediately upon printing this message, afterwards it runs fine.

@david-d-an
Copy link

I get the error only on M1 Mac but Intel Mac doesn't throw any errors. The same Node version (14.16.1), same code, same packages. Only difference is M1 and Intel chips. Is anyone having trouble on Intel Mac?

@CallumHoward
Copy link

@dong82 I'm seeing it on Intel Mac with node 12 (so old, I know).

@david-d-an
Copy link

M1 issue was addressed by Cypress themselves. See their article here.

@cypress-bot cypress-bot bot added stage: backlog and removed stage: ready for work The issue is reproducible and in scope labels Apr 29, 2022
@apaatsio
Copy link

apaatsio commented May 4, 2022

The error doesn't seem to affect the test run. But to get rid of it anyway, for me it helped just to unset the environment variable before running cypress.

unset NODE_OPTIONS

FWIW, I'm using cypress 8.6.0 on an Intel Mac.

@vinayg-cp
Copy link

The error doesn't seem to affect the test run. But to get rid of it anyway, for me it helped just to unset the environment variable before running cypress.

unset NODE_OPTIONS

FWIW, I'm using cypress 8.6.0 on an Intel Mac.

This worked for me.

@wmadden
Copy link

wmadden commented Jun 15, 2022

FYI NODE_OPTIONS is set by Yarn to add the PnP module loader to Node when you use yarn exec, so if you're using Yarn PnP you probably shouldn't unset it. Even if you're not using PnP it's probably worth checking what value it's set to 🤷🏻

@mehrshadFarzaneh
Copy link

mehrshadFarzaneh commented Sep 20, 2022

I solved this problem
But the point is that I use Angular version 14

I run the commandng e2eto solve this problem
Then I selected cypress among the suggested options in the command line

@lmiller1990
Copy link
Contributor

lmiller1990 commented Apr 7, 2023

I am also running into this, I think NODE_OPTIONS is not getting respected (which yarn uses to set the --require for their PnP feature) which is why #25960 is a problem.

I am trying to find out how to fix this. The warning is from Electron: https://www.electronjs.org/docs/latest/api/environment-variables#node_options. Specifically

NODE_OPTIONS are explicitly disallowed in packaged apps, except for the following:

--max-http-header-size
--http-parser

Hmm, wonder if we can make this work somehow.

@radthenone
Copy link

i have this same problem used docker and vite

@nagash77 nagash77 removed the prevent-stale mark an issue so it is ignored by stale[bot] label Apr 24, 2023
@nagash77 nagash77 added CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels Apr 24, 2023
@MikeMcC399
Copy link
Contributor

This issue also affects Cypress E2E tests using Yarn Modern pnp. It is not restricted to CT.

@lmiller1990
Copy link
Contributor

Is this causing anyone to be unable to run tests or is mostly a style thing (eg - you don't like seeing a warning, even if it has no impact on you runs)?

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented May 8, 2023

@lmiller1990

Is this causing anyone to be unable to run tests or is mostly a style thing (eg - you don't like seeing a warning, even if it has no impact on you runs)?

I haven't seen any test impact. The Electron warning always appears with Yarn Plug'n'Play, presumably because Electron is always used in the first phase, even if subsequently another browser is used for tests.

@AlexPandovich
Copy link

AlexPandovich commented May 16, 2023

Hello

I have similar issue with running nodemon as debug configuration for VS code on Windows10 for Node.js by using .vscode/launch.json:

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "nodemon",
			"runtimeExecutable": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
			"restart": true,
			"console": "integratedTerminal",
			"internalConsoleOptions": "neverOpen"
		}
	]
}

In my case:

  • remove nodemon from dev dependecies.(npm uninstall -D nodemon)
  • install it as global package (npm install -g nodemon)
  • change "runtimeExecutable": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js", to "runtimeExecutable": "nodemon",

Command line changed
from:

:${env:NODE_OPTIONS}='--require "c:/Users/38098/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.js" --inspect-publish-uid=http'; ${env:VSCODE_INSPECTOR_OPTIONS}='{"inspectorIpc":"\\\\.\\pipe\\node-cdp.18452-04647856-1.sock","deferredMode":false,"waitForDebugger":"","execPath":"C:\\Program Files\\nodejs\\node.exe","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"C:\\Users\\38098\\AppData\\Local\\Temp\\node-debug-callback-5477a4347fa4ae67"}';
& **'D:\projects\4-nodejs-demo-3/node_modules/nodemon/bin/nodemon.js'**

to:

${env:NODE_OPTIONS}='--require "c:/Users/38098/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.js" --inspect-publish-uid=http'; ${env:VSCODE_INSPECTOR_OPTIONS}='{"inspectorIpc":"\\\\.\\pipe\\node-cdp.7668-3e75cba0-11.sock","deferredMode":false,"waitForDebugger":"","execPath":"C:\\Program Files\\nodejs\\node.exe","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"C:\\Users\\38098\\AppData\\Local\\Temp\\node-debug-callback-03f1f420e5a7512e"}'; 
& **'C:\Users\38098\AppData\Roaming\npm\nodemon.cmd'**

And it starts to work.

@safydy
Copy link

safydy commented Jul 26, 2023

For my case, I was using "cypress": "^12.17.2",

Nothing has changed on my yarn.lock, but that workaround did resolve my issue. Very strange !!!

@AStoker
Copy link

AStoker commented Sep 21, 2023

Adding my voice to the group. Experiencing this with latest version of Cypress (^13.0.0).
Our setup is using NX to create an single Angular application. We then set up Yarn PnP, and then ran the cypress command to configure component tests (yarn nx g @nx/angular:cypress-component-configuration --project=my-project --build-target=my-projectr:build).

We then get this

[50088:0921/113920.188:ERROR:node_bindings.cc(300)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

Followed by this

DevTools listening on ws://127.0.0.1:53068/devtools/browser/60158d19-8ee0-4092-bc24-6df5ffca7643
Your configFile is invalid: C:\Projects\***\cypress.config.ts

It threw an error when required, check the stack trace below:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for C:\Projects\***\cypress.config.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
    at defaultLoad (node:internal/modules/esm/load:91:20)
    at nextLoad (node:internal/modules/esm/hooks:733:28)
    at load$1 (file:///C:/***/.pnp.loader.mjs:1456:12)
    at nextLoad (node:internal/modules/esm/hooks:733:28)
    at Hooks.load (node:internal/modules/esm/hooks:377:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:778:20)

@MikeMcC399
Copy link
Contributor

@AStoker

@TheDirigible
Copy link

Still happening with the latest version.

@illegalnumbers
Copy link

I also see this on latest

@adico1

This comment was marked as duplicate.

@irv-armenta-g

This comment was marked as duplicate.

2 similar comments
@alvincrespo

This comment was marked as duplicate.

@PeppeColi

This comment was marked as duplicate.

@MikeMcC399
Copy link
Contributor

As mentioned in #19229 (comment) quite some time ago, this issue also affects E2E in a Yarn Modern pnp environment.

See https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml?query=branch%3Amaster for logs, which include the sequence:

[2195:1118/160259.798927:ERROR:node_bindings.cc(305)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[2195:1118/160259.798984:ERROR:node_bindings.cc(305)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[2195:1118/160259.798991:ERROR:node_bindings.cc(305)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[2195:1118/160259.798998:ERROR:node_bindings.cc(305)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

This is Cypress 13.15.2 running under Ubuntu 24.04.1.

@jennifer-shehane jennifer-shehane added package manager: yarn Issues relating to yarn type: error message and removed type: bug Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. CT Issue related to component testing labels Dec 10, 2024
@jennifer-shehane jennifer-shehane changed the title "Most NODE_OPTIONs are not supported in packaged apps" when running cypress component testing "Most NODE_OPTIONs are not supported in packaged apps" when using yarn pnp Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests