Files
Shu DingandGitHub 7e9627a390 Fix tracking of ContextModule (#52795)
When doing dynamic imports like `import(variable)`, Webpack _tries_ to statically analyze it and creates a regex like context module for it (which includes all possible modules). This `ContextModule` doesn't have a resource path so we need to use the identifier to track it.

Tested with @alexkirsz's repro here https://github.com/vercel/next.js/issues/50243#issuecomment-1628675346 and confirmed that it fixes the problem.

Closes #50243.
2023-07-17 17:41:04 +00:00

6 lines
158 B
JavaScript

export default async function Page() {
const dynamic = '_dynamic'
const { default: Component } = await import(`./${dynamic}.js`)
return <Component />
}