Skip to content

Snapshotting ES Modules #3981

Description

@krk

ES Modules cannot be snapshotted now, the configure time parameter --node-snapshot-main fails with the error

SyntaxError: Cannot use import statement outside a module
    at main (node:internal/main/mksnapshot:129:33)
    at node:internal/main/mksnapshot:169:1

which in turn points to https://github.com/nodejs/node/blob/v18.9.0/src/node_snapshotable.cc#L1198-L1224.

I was wondering if this is expected and is supporting ES Module snapshots viable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions