nodejs / nodejs/undici

Support for node --build-snapshot

Open
#4,669 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
879
Avg merge
2d 16h
Merged PRs (30d)
68

Description

This would solve...

Currently when trying to use --build-snapshot with undici, it fails with:

ReferenceError: WebAssembly is not defined
    at lazyllhttp (/Users/samypesse/Projects/gitbook-x/services/cloudrun/api/dist/api/dev/dist/index.dev.js:229040:9)
    at ../../../node_modules/.pnpm/undici@6.21.3/node_modules/undici/lib/dispatcher/client-h1.js

The implementation should look like...

I'm not sure at all, to be honest it might just boils to how Node.js could support (or not) WebAssembly for snapshotting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by investigating how Node.js --build-snapshot handles WebAssembly and the failure raised while loading undici's lazyllhttp path. Determine whether undici can support this snapshot mode or whether the limitation belongs to Node.js; done should establish and validate the appropriate support outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, wasm
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.