Skip to content

False warning "built-in module … is not yet supported in user snapshots" #80

Description

@lukaslihotzki

require("http") during snapshot creation does not work and I assume that's why this warning exists at all. However, require("http") in the deserialize main function (so, after snapshot creation) works fine, but still prints this warning (when the snapshot is run):

(node:161191) Warning: built-in module http is not yet supported in user snapshots
(Use `hello --trace-warnings ...` to show where the warning was created)

It is really safe to require all built-in modules in the deserialize main function? If so, this warning should be silenced in these cases.

Activity

  1. joyeecheung commented on Nov 27, 2023

    @joyeecheung
    Member

    This is probably less of a SEA issue, some things I think can be done:

    1. Make the warning clearer - it's more of a "use it at your own risk" warning. "not yet supported" means we haven't fully verified the said module works in snapshots. It might still work fine for some use cases, though for other use cases there might be subtle bugs because we haven't added the necessary synchronization for the serialization/deserialization passes (or we just haven't looked into it deeply to check if there are synchronization needed or not)
    2. We can emit the warning only when the snapshot is built. In general loading a new module not yet loaded in snapshot at deserialization time is safe.
  2. joyeecheung commented on Feb 15, 2024

    @joyeecheung
    Member

    Did 1 and 2 in nodejs/node#50944

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions