Skip to content

new_module_registry V2 fallback service protocol missing rawSpecifier and attributes fields #6474

@jamesopstad

Description

@jamesopstad

Description

When using the new_module_registry compatibility flag with a module fallback service, the V2 protocol request is missing the rawSpecifier and attributes fields.

Expected Behavior

Per the V2 fallback service protocol schema, the JSON body should include:

{
  "type": "import",
  "specifier": "file:///bundle/missing-module.js",
  "rawSpecifier": "./missing-module.js",
  "referrer": "file:///bundle/worker.js",
  "attributes": []
}

Actual Behavior

The rawSpecifier and attributes fields are never sent:

{
  "type": "import",
  "specifier": "file:///bundle/missing-module.js",
  "referrer": "file:///bundle/worker.js"
}

Root Cause

In src/workerd/jsg/modules-new.c++, resolveWithCaching() creates a new ResolveContext but does not copy the rawSpecifier or attributes fields from the original context.

Reproduction

https://github.com/jamesopstad/v2-fallback-service-protocol-repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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