mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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.
6 lines
158 B
JavaScript
6 lines
158 B
JavaScript
export default async function Page() {
|
|
const dynamic = '_dynamic'
|
|
const { default: Component } = await import(`./${dynamic}.js`)
|
|
return <Component />
|
|
}
|