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

Node SEA ESM support #53565

Open
guoh27 opened this issue Jun 24, 2024 · 3 comments
Open

Node SEA ESM support #53565

guoh27 opened this issue Jun 24, 2024 · 3 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. feature request Issues that request new features to be added to Node.js. single-executable Issues and PRs related to single-executable applications

Comments

@guoh27
Copy link

guoh27 commented Jun 24, 2024

What is the problem this feature will solve?

Nodejs version 20.15.0,
I have a .mjs file, use node --experimental-sea-config sea-config.json pack as a blob,
and then npx postject hello NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 successful,
but ./hello will throw Require a ESM error.
So, packing ESM module into SEA single executable is not available now.

What is the feature you are proposing to solve the problem?

Packing ESM module as a single exeutable.

What alternatives have you considered?

Another feature request is: bake v8 options into executable to run with them on, like pkg's --options argument

@guoh27 guoh27 added the feature request Issues that request new features to be added to Node.js. label Jun 24, 2024
@guoh27
Copy link
Author

guoh27 commented Jun 24, 2024

Now I have to use a .cjs wrapper, and dynamic import my .mjs app entry, which is ugly.

@guoh27
Copy link
Author

guoh27 commented Jun 24, 2024

according to lib/internal/util/embedding.js#L19

@RedYetiDev RedYetiDev added esm Issues and PRs related to the ECMAScript Modules implementation. single-executable Issues and PRs related to single-executable applications labels Jun 24, 2024
@guoh27
Copy link
Author

guoh27 commented Jun 25, 2024

Don’t forget the --options parameter like pkg:

image

@RedYetiDev RedYetiDev moved this from Awaiting Triage to Triaged in Node.js feature requests Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. feature request Issues that request new features to be added to Node.js. single-executable Issues and PRs related to single-executable applications
Projects
Development

No branches or pull requests

2 participants