Files
next.js/test/e2e/css-data-url-global-pages/css-data-url-global-pages.test.ts
5fa40c806c exempt data URL CSS from Pages Router global CSS restriction (#89901)
### 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

- [x] Related issues linked using `fixes #89900`
- [x] Tests added

---------

Co-authored-by: Tim Neutkens <[email protected]>
2026-03-03 11:17:30 +01:00

22 lines
540 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
// CSS data urls are only supported in Turbopack
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
'css-data-url-global-pages',
() => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should apply styles from data url correctly', async () => {
const browser = await next.browser('/')
const fontWeight = await browser
.elementByCss('#styled')
.getComputedCss('font-weight')
expect(fontWeight).toBe('700')
})
}
)