Fix next/dynamic non ssr in pages when appDir is enabled (#45066)
When `appDir` is enabled, `next/dynamic` with `ssr: false` didn't get correctly compiled with swc. The `server_components` condition in next_dynamic transform should respect to the server components compilation, but it was accidently turned on when server components is enabled. This PR fixes it that only turn on the flag when it's in server components compilation (when `is_server` option is `true`) reported by @MaxLeiter ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment