Skip to content

exempt data URL CSS from Pages Router global CSS restriction#89901

Merged
timneutkens merged 5 commits intovercel:canaryfrom
jantimon:fix/css-data-url-pages-router
Mar 3, 2026
Merged

exempt data URL CSS from Pages Router global CSS restriction#89901
timneutkens merged 5 commits intovercel:canaryfrom
jantimon:fix/css-data-url-pages-router

Conversation

@jantimon
Copy link
Contributor

What?

Skip the Pages Router global CSS restriction for data: URL imports (similar to app router and mixed app/pages router)

Why?

data:text/css should work the same no matter if pages router, app router or mixed router usage

How?

the validation in crates/next-api/src/module_graph.rs already had a carve-out for node_modules. This adds the same for data URL modules.

fixes #89900

  • Related issues linked using fixes #89900
  • Tests added

data:text/css imports are generated by tooling (e.g. next-yak) and
are inline per-component — the global CSS ordering concern doesn't
apply. The validation already had a carve-out for node_modules,
this adds the same for data URL modules.
@nextjs-bot nextjs-bot added tests Turbopack Related to Turbopack with Next.js. labels Feb 12, 2026
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 12, 2026

Allow CI Workflow Run

  • approve CI run for commit: 9b33081

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@jantimon jantimon force-pushed the fix/css-data-url-pages-router branch from 9f4ebb1 to 4e64c02 Compare February 12, 2026 10:05
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing jantimon:fix/css-data-url-pages-router (d9d4889) with canary (420b72b)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on canary (872c01b) during the generation of this report, so 420b72b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 17, 2026

Tests Passed

TypeScript resolves data:text/css imports without error, making the
directive unused and failing the build type-check step.
@jantimon
Copy link
Contributor Author

@timneutkens can we please rerun the pipeline?

@jantimon
Copy link
Contributor Author

@timneutkens the pnpm windows issues seem to be unrelated - can we just try again or should i fix anything?

@jantimon
Copy link
Contributor Author

jantimon commented Mar 3, 2026

@timneutkens ?

@timneutkens timneutkens added the CI approved Approve running CI for fork label Mar 3, 2026
@timneutkens timneutkens merged commit 5fa40c8 into vercel:canary Mar 3, 2026
273 of 278 checks passed
@jantimon
Copy link
Contributor Author

jantimon commented Mar 3, 2026

thank you @timneutkens

this will allow us a lot to migrate our pages router app to turbopack

@timneutkens
Copy link
Member

I'll push a new canary so that you can try it 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI approved Approve running CI for fork tests Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data:text/css imports fail in Pages Router with Turbopack

3 participants