Skip to content

Node SEA ESM support #53565

New issue

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

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

Already on GitHub? # to your account

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

Node SEA ESM support #53565

guoh27 opened this issue Jun 24, 2024 · 5 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

@avivkeller avivkeller 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

@avivkeller avivkeller moved this from Awaiting Triage to Triaged in Node.js feature requests Jun 27, 2024
Copy link
Contributor

There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Mark issue so that it is never considered stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Dec 23, 2024
@guoh27
Copy link
Author

guoh27 commented Dec 23, 2024

Still ongoing.

# for free to join this conversation on GitHub. Already have an account? # 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

3 participants