Skip to content

Node SEA ESM support #53565

Description

@guoh27

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

Activity

  1. guoh27 commented on Jun 24, 2024

    @guoh27
    Author

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

  2. guoh27 commented on Jun 24, 2024

    @guoh27
    Author
  3. added
    esmIssues and PRs related to the ECMAScript Modules implementation.
    single-executableIssues and PRs related to single-executable applications.
    on Jun 24, 2024
  4. guoh27 commented on Jun 25, 2024

    @guoh27
    Author

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

    image

  5. moved this from Awaiting Triage to Triaged in Node.js feature requestson Jun 27, 2024
  6. github-actions commented on Dec 23, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Issues and PRs exempt from automated stale handling. 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.

  7. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Dec 23, 2024
  8. guoh27 commented on Dec 23, 2024

    @guoh27
    Author

    Still ongoing.

  9. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Dec 23, 2024
  10. niceEli commented on May 5, 2025

    @niceEli

    any updates?

  11. added
    never-staleIssues and PRs exempt from automated stale handling.
    on May 5, 2025
  12. ndunks commented on Sep 17, 2025

    @ndunks

    I also struggling for using SEA with load external ESM module, since my app is quite large, I need to extract the files at startup and switch to it.

  13. joyeecheung commented on Feb 19, 2026

    @joyeecheung
    Member

    Fixed by #61813

  14. joyeecheung commented on Feb 19, 2026

    @joyeecheung
    Member

    Although, #61813 only supports loading a bundled ESM. OP seems to intend to load other modules from within the SEA. In that case, you'd need VFS support #61478 - both CJS and ESM entrypoint only support loading the non-built-ins.

    Reading through this thread, it feels like folks might be hoping for a bit of magic to get SEA features. But like almost everything in Node.js, it’s driven by volunteers fitting it into their spare time. If you really want to see SEA features move forward, the best bet is to jump in and contribute yourself, or if this is relied on by a for-profit entity, consider having them sponsor someone to develop it. Otherwise, we'll end up in that familiar loop: lots of feature requests over the years, but no one with the free time to actually write the code, it might get fixed because an existing contributor happen to have a few free nights/weekends, but there will be zero assurance about progress.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.feature requestIssues requesting new Node.js features.never-staleIssues and PRs exempt from automated stale handling.single-executableIssues and PRs related to single-executable applications.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions