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

Electron ignores NODE_OPTIONS #13402

Closed
alexeykuzmin opened this issue Jun 23, 2018 · 14 comments
Closed

Electron ignores NODE_OPTIONS #13402

alexeykuzmin opened this issue Jun 23, 2018 · 14 comments

Comments

@alexeykuzmin
Copy link
Contributor

alexeykuzmin commented Jun 23, 2018

https://nodejs.org/api/cli.html#cli_node_options_options
Related to #12695.

@bpasero
Copy link
Contributor

bpasero commented Aug 22, 2018

@alexeykuzmin with this, how can I trace deprecations in node.js? I need to pass over a flag such as --trace-deprecation to find out where a deprecated API is being used, such as:

image

@RyanHanekamp
Copy link

I would like to enable --experimental-modules for Node in Electron 3.0.x beta. I am intensely curious as to how this is going to work for renderer process modules. This entire can of worms is probably not yet ready for prime time, but I want to see how far I can go down this rabbit hole.

This issue prevents me from trying, unless there is another means by which to pass Node options that I haven't been able to google or find in the Electron documentation. Putting it into the Electron command line also has no effect.

@danielscottjames
Copy link

danielscottjames commented Sep 5, 2018

We have a fork of VSCode that starts Node as a new process instead of forking node, due to this issue. (We need to increase the memory allocated to forked node processes)
More details: microsoft/vscode#33524

@dotnetCarpenter
Copy link

This seems to have been implemented in #15259 electron 4.0. Is that correct? If yes, I guess this can be closed.

@dotnetCarpenter
Copy link

wait, what?

NODE_OPTIONS are explicitly disallowed in packaged apps.

https://github.com/electron/electron/blob/23d44e322d4265b925758103a7fb5802ebefae8c/docs/api/environment-variables.md#node_options

--experimental-modules are not useful if they can not be used after packaging the app.
Too bad for me but @RyanHanekamp perhaps it's enough to satisfy your curiosity.

@bpasero
Copy link
Contributor

bpasero commented Jan 16, 2019

When I tested with Electron 4 I was able to use NODE_OPTIONS to print deprecations.

@dotnetCarpenter
Copy link

dotnetCarpenter commented Jan 16, 2019

From what I understand from environment-variables.md, you can use most node flags but only during development. Which defeats the purpose of using --experimental-modules (import/export).

I have got around 30 files I need to run in Electron using that are using ES modules and now I have to transpile them before I can use them in Electron 4.0.

@stefaneidelloth
Copy link

stefaneidelloth commented Feb 15, 2019

I also would like to be able to use ES6 modules. First I faced the issue of mime type checking and now the issue of serving the files from the file system. Would be great if ES6 modules would just work in Electron. Some related issues:

@sofianguy
Copy link
Contributor

Thank you for taking the time to report this issue and helping to make Electron better.

The version of Electron you reported this on has been superseded by newer releases.

If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.

Thanks in advance! Your help is appreciated.

@sofianguy sofianguy added the blocked/need-info ❌ Cannot proceed without more information label Aug 9, 2019
@TomasHubelbauer
Copy link
Contributor

This is the top Google result for electron --experimental-modules. I think it would be useful to either show how to use ESM in the new Electron version here in a comment or point to a current issue dealing with using ESM modules in latest Electron.

@dotnetCarpenter
Copy link

@TomasHubelbauer The point of #13402 (comment) is that you can not use --experimental-modules with electron once you package it (e.i. your final app executable). The short answer is, electron does not support ESM.

NODE_OPTIONS are explicitly disallowed in packaged apps.

I'm unaware of any issues in this repo dealing with enabling --experimental-modules in electron. But perhaps you can create one?

PS. A quick search on "experimental-module" gave me #18540 and #14011.

@sofianguy sofianguy added enhancement ✨ and removed blocked/need-info ❌ Cannot proceed without more information labels Aug 19, 2019
@codebytere
Copy link
Member

Closed by a0b9d47

@liximomo
Copy link

liximomo commented Oct 24, 2019

Why we can't use NODE_OPTIONS in a packaged app? I need to set --max-http-header-size which is the only way to fix Header overflow!

@flotwig
Copy link
Contributor

flotwig commented Oct 29, 2019

Why we can't use NODE_OPTIONS in a packaged app? I need to set --max-http-header-size which is the only way to fix Header overflow!

@liximomo I've opened an issue specifically for --max-http-header-size here: #20831

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

No branches or pull requests