Demonstrates a bug in workerd's V2 fallback service protocol where rawSpecifier
and attributes fields are never sent.
When using new_module_registry, the fallback service should receive:
type: How the module was imported ("import", "require", "internal")specifier: Normalized URL of the modulerawSpecifier: Original specifier as written in source codereferrer: Normalized URL of the importing moduleattributes: Import attributes (e.g.{ type: "json" })
Actual behavior: Only type, specifier, and referrer are sent.
In src/workerd/jsg/modules-new.c++:807-818, resolveWithCaching() creates a
new ResolveContext but does not copy rawSpecifier or attributes.
pnpm install
# Terminal 1
pnpm start
# Terminal 2
pnpm workerd
# Terminal 3
curl http://localhost:8080/Expected (per schema):
{
"type": "import",
"specifier": "file:///bundle/missing-module.js",
"rawSpecifier": "./missing-module.js",
"referrer": "file:///bundle/worker.js",
"attributes": []
}Actual (bug):
{
"type": "import",
"specifier": "file:///bundle/missing-module.js",
"referrer": "file:///bundle/worker.js"
}