mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? make sure that we don't error for dynamic requests on server side. It will throw at runtime when using a dynamic request. ### Why? Not all packages are fully bundler compatible, but still work when only using the parts that work. We don't want to block users from using them by having an hard compile error. ### How? Closes PACK-2675
11 lines
196 B
TypeScript
11 lines
196 B
TypeScript
export function GET() {
|
|
if (Math.random() < 0) dynamic()
|
|
return new Response('Hello World')
|
|
}
|
|
|
|
function dynamic() {
|
|
const dynamic = Math.random() + ''
|
|
require(dynamic)
|
|
import(dynamic)
|
|
}
|