next.js
b7a532c3 - Fix unset crossOrigin in Turbopack manifests (#97164)

Commit
4 hours ago
Fix unset crossOrigin in Turbopack manifests (#97164) ## Summary Prevent Turbopack from adding `crossorigin=""` to generated script tags when `crossOrigin` is not configured, and add production coverage for static prerendering, dynamic rendering, and `output: 'export'`. This regressed in #92070 when Turbopack added `crossOriginLoading` support. The client reference manifest changed from an optional cross-origin value to the shared `CrossOrigin` enum. Serde serialized the enum's default `None` variant as the string `"none"`, so React saw a present string and treated it as anonymous CORS, emitting `crossorigin=""`. Webpack continued to omit its `undefined` value. Skip serializing `CrossOrigin::None` in the Turbopack client reference manifest so an unset option remains absent while preserving explicit anonymous and credentialed modes. ## Verification - `NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-turbo test/e2e/app-dir/app-config-crossorigin/index.test.ts` - `NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-webpack test/e2e/app-dir/app-config-crossorigin/index.test.ts` <!-- NEXT_JS_LLM -->
Author
Parents
Loading