Files
vercel__next.js/test/e2e/url/app/layout.js
Niklas Mischkulnig f80c92261e Turbopack: expose client static assets correctly (#84695)
This is about whether `new URL("logo.png", import.meta.url)` and `import logo from "./logo.png"` return a client or a server asset:

- a server asset is a file that will be read by the server during rendering, for example a Wasm or font file (if you think about vercel/og image generation). It's stored on the server next to the JS chunks
- a client asset is a file that will be used by the browser, e.g. for an `<img src={logo}/>` usecase. It will be stored on the CDN and have the `_next/` prefix.

For

- client contexts, it's easy: all imports are client assets (unsurprisingly)
- SSR contexts, we emulate the client (to prevent hydration mismatches)
- API/metadata context, it's less clear cut what should happen, but we arbitrarily do the following: `new URL` returns server assets and `import logo` returns client assets.

That very last case of having client assets for imports, and server assets for `new URL` wasn't implemented in Turbopack.

Turbopack doesn't change anything here fundamentally, but Webpack appears to have some bugs where this is less consistent (across nodejs/edge and api/metadata routes for example). See tests added in https://github.com/vercel/next.js/pull/84636

Closes PACK-4874
Closes PACK-5649
Closes #80577
2025-10-15 18:06:50 +02:00

8 lines
131 B
JavaScript

export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}