Unverified Commit 7ef6c4eb authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Revert "Fix: css in next/dynamic component in edge runtime" (#64442)

The fix is not correct, we already have request ALS wrapping the request
in app-render, shouldn't get another one for edge adapter. This is
actually a bundler bug

Reverts vercel/next.js#64382

Closes NEXT-3097
parent 904908cf
...@@ -244,13 +244,7 @@ export async function adapter( ...@@ -244,13 +244,7 @@ export async function adapter(
) )
) )
} }
return RequestAsyncStorageWrapper.wrap( return params.handler(request, event)
requestAsyncStorage,
{
req: request,
},
() => params.handler(request, event)
)
}) })
// check if response is a Response object // check if response is a Response object
......
...@@ -5,10 +5,10 @@ export function PreloadCss({ moduleIds }: { moduleIds: string[] | undefined }) { ...@@ -5,10 +5,10 @@ export function PreloadCss({ moduleIds }: { moduleIds: string[] | undefined }) {
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
return null return null
} }
const getExpectedRequestStore: typeof import('../../../client/components/request-async-storage.external').getExpectedRequestStore = const {
require('../../../client/components/request-async-storage.external').getExpectedRequestStore getExpectedRequestStore,
} = require('../../../client/components/request-async-storage.external')
const requestStore = getExpectedRequestStore('next/dynamic css') const requestStore = getExpectedRequestStore()
const allFiles = [] const allFiles = []
......
export { default } from '../page'
export const runtime = 'edge'
...@@ -31,23 +31,6 @@ createNextDescribe( ...@@ -31,23 +31,6 @@ createNextDescribe(
}) })
}) })
it('should only apply corresponding css for page loaded in edge runtime', async () => {
const browser = await next.browser('/ssr/edge')
await retry(async () => {
expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('.text')).color`
)
).toBe('rgb(255, 0, 0)')
// Default border width, which is not effected by bar.css that is not loaded in /ssr
expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('.text')).borderWidth`
)
).toBe('0px')
})
})
it('should only apply corresponding css for page loaded that /another', async () => { it('should only apply corresponding css for page loaded that /another', async () => {
const browser = await next.browser('/another') const browser = await next.browser('/another')
await retry(async () => { await retry(async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment