Repository: next.js
Issue: Next14 multiple re-renders issue using Dynamic Import with Server Actions, SWR and Next Auth 
Labels: bug,Lazy Loading,Pages Router

### Link to the code that reproduces this issue

https://github.com/AnasArafeh/Nextjs14-DynamicImport-SWR-ServerAction-NextAuth-Issue

### To Reproduce

1. Start the application ( linked Repo )
2. Open browser ( http://localhost:3000 )
3. Refresh the page

### Current vs. Expected behavior

Following the steps the client component should not render more than two times at max. However, the component is being re-rendered depending on how many dynamic imports we have in the page ( does not matter if the page is parent or not ), the more we add the more renders.

The issue happens exactly when we combine Dynamic imports with Server actions, SWR and next auth. So to be honest not sure where the issue exactly lays. But this is how we can reproduce it:

I call "useSession" and "useSWR" in client component. The "useSWR" is calling "getProducts" which is a "server action" and the "server action" is calling "getServerSession" from "next auth" and after that it calls an api to get the data. And the "server page" is dynamically importing (server / client) components. 

1- In case I change dynamic import to static import the issue disappear.
2- In case I remove/comment either of "useSession" or "useSWR" in the client component the issue disappear.
3- In case I remove "getServerSession" from the server action the issue disappear.
4- In case I put the fetcher function "getProducts" in the client page and for example call an API route which calls "getServerSession" the issue also disappear.

you can check the below screenshot for see an example. for detailed info please check the linked repo.

client component 
![image](https://github.com/vercel/next.js/assets/68680829/2d7d55db-74fa-42e1-9525-a42145d80636)

server action component
![image](https://github.com/vercel/next.js/assets/68680829/b504dd8d-fb01-42f4-85d5-4694e8dac58d)


page code sample
![image](https://github.com/vercel/next.js/assets/68680829/da9110e1-0f73-4457-b688-f29634a211e0)

browser screenshot
![image](https://github.com/vercel/next.js/assets/68680829/fa44d03f-384a-4d6a-8d3b-3848fe022fa1)

even we I remove the client component from the parent page and put it for example in the layout the issue persists

![image](https://github.com/vercel/next.js/assets/68680829/c3507fa2-b918-4ae6-891b-e1e777434094)





### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Enterprise
Binaries:
  Node: 18.18.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.5-canary.45
  eslint-config-next: 14.0.5-canary.45
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Data fetching (gS(S)P, getInitialProps), Dynamic imports (next/dynamic)

### Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

### Additional context

I tested the issue in version 14.0.3, 14.0.4 and 14.0.5-canary.45 and all of them produce this issue