-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEXT-670] Faulty app/
Static to Dynamic Error When POST fetches are used from layout.tsx
#46436
Comments
+1 |
1 similar comment
+1 |
Similar issue happening here, both on layout and individual page files. GraphQL fetch requests using POST are returning undefined. I have one header/footer fetch in the root layout and a page fetch under a page slug folder. Interestingly it fetches either one or the other, but never both at the same time. All my fetches have a revalidate setting, but I can load one page fine if I swap out the header/footer fetch revalidate setting with force cache. At this point a route change will trigger the same static to dynamic error as mentioned in the OP. |
How about adding |
For me |
Interesting |
Agree. I'm guessing that the new cache policy in 13.2 is that requests with |
c533613#diff-4c54e369ddb9a2db1eed95fe1d678f94c8e82c540204475d42c78e49bf4f223aR64-R66 not sure, but this diff seems to be triggering it? update: I tried run without it, and without the part, repro is working fine |
app/
Static to Dynamic Error When POST fetches are used from layout.tsxapp/
Static to Dynamic Error When POST fetches are used from layout.tsx
Similar issue here, already reported #45134. |
But when you downgrade you have other problems with fetch. So this is no Solution. |
This corrects the static to dynamic error incorrectly showing in development since we don't have enough information to accurately know if this error should be thrown or not unless a build has been done. Fixes: #46436 x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1677637140906959) ## 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)
Hi, this has been updated in |
Thanks a lot @ijjk . |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps)
Link to the code that reproduces this issue
https://github.com/kulgg/app-static-to-dynamic-reproduction
To Reproduce
Start the development server and navigate to /one.
The
app/
Static to Dynamic Error will be shown.Describe the Bug
POST request fetches from a layout component inside a dynamic segment route that uses generateStaticParams will lead to a faulty
app/ Static to Dynamic Error
.GET requests work without problems.
On build the should-be SSG routes turn into server-side rendered routes.
Expected Behavior
As with GET requests, the statically generated dynamic segment routes should be generated for POST requests without problems
Which browser are you using? (if relevant)
Brave Version 1.48.171 Chromium: 110.0.5481.177
How are you deploying your application? (if relevant)
No response
NEXT-670
The text was updated successfully, but these errors were encountered: