Skip to content

test(turbopack): cover package module specifiers in worker URLs#9

Draft
vercel-gh-bot-2[bot] wants to merge 1 commit into
next-maintainer-agent/base-80fd3fed693bfrom
next-maintainer-agent/issue-94015-8261d5960b13
Draft

test(turbopack): cover package module specifiers in worker URLs#9
vercel-gh-bot-2[bot] wants to merge 1 commit into
next-maintainer-agent/base-80fd3fed693bfrom
next-maintainer-agent/issue-94015-8261d5960b13

Conversation

@vercel-gh-bot-2

Copy link
Copy Markdown

What this tests

Adds regression coverage for vercel#94015 to the existing App Router worker suite. The fixture models a third-party package with conditional wildcard exports whose client API creates a worker from a bare package module specifier:

new Worker(new URL('worker-package/worker.js', import.meta.url))

The browser assertion requires the packaged worker to start and post worker-loaded. This is the smallest native equivalent of the verified GraphiQL/monaco-graphql path and avoids carrying the full editor dependency graph.

Local precedent

The coverage extends test/e2e/app-dir/worker/worker.test.ts, reusing its real fixture directory, nextTestSetup, browser interaction, beforePageLoad worker request checks, and retry() assertion style.

Verification provenance

The stored verifier reports that the production GraphQL worker URL reaches the unsafe Turbopack parseRequest URL normalizer on both the reported revision and frozen canary. Running node verify.mjs in the materialized reproduction on 16.2.6 completed the production build and reported symptomPresent: true.

Commands and results

pnpm test-start-turbo test/e2e/app-dir/worker/worker.test.ts -t 'package module specifiers'

Fails on untouched 16.3.0-canary.92 at the new assertion, as required for a still_reproduces regression test:

Expected: "worker-loaded"
Received: "error: e.indexOf is not a function"
pnpm test-dev-turbo test/e2e/app-dir/worker/worker.test.ts -t 'package module specifiers'

Also fails at the same assertion in the unminified runtime:

Expected: "worker-loaded"
Received: "error: request.indexOf is not a function"
pnpm test-start-webpack test/e2e/app-dir/worker/worker.test.ts -t 'package module specifiers'
pnpm test-dev-webpack test/e2e/app-dir/worker/worker.test.ts -t 'package module specifiers'

Both pass.

Formatting and lint checks pass for all changed files. Expected CI state is intentionally red for the new assertion in Turbopack development and production modes until the framework bug is fixed; the corresponding webpack modes should remain green.

Next-Maintainer-Receipt: v1.ojGI4WblTRW96gOPpmw19HmxN8HHA7baxuJVc6SGtcQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants