-
Notifications
You must be signed in to change notification settings - Fork 26k
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
sitemap.ts
marked as as "use client"
in version 13.4.9
#52390
Comments
It started happening at canary 2, so one of commits between 1 and 2 causes this. |
Looking at the diff it's caused by this change: #51950 |
After we separating the metadata routes to a separate layer, we didn't apply the webpack alias rules properly to it as it's should still be treated as pure "server" side This PR fixes the aliasing for that new metadata layer and make it working properly with "server-only" Fixes #52390
Seeing this same error with my icon.tsx file which is exporting a default async function which is getting headers from next/headers. I get the error:
None of the parents are client components. It looks like the fix you pushed is only for those marked w/ server-only? |
@franzwarning The fix is landed on latest canary, please upgrade to canary. The |
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 Router
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Svish/geekality.net/tree/e1a6cda84d9c3bd1879f405f96c616102fdeee8a
To Reproduce
npm i next@13.4.9
(or.10-canary.0
)import 'server-only'
in a file that's imported by./src/app/sitemap.ts
.npm run build
Describe the Bug
I have a file that uses
import 'server-only'
to make sure it doesn't leak into client components. In version13.4.8
this was working fine, but once I tried to updatenext
to the current13.4.9
, I'm suddenly getting an error because of this. And the weirder part is that the error seem to be coming from my./src/app/sitemap.ts
, which is definitely not using any client components, it's actually not using any components at all. It's the metadata route for sitemaps from Next. 🤔Here's the output from running
npm run build
on version13.4.9
. The latest canary produces the same error:Expected Behavior
The
import 'server-only'
in my./src/content/index.ts
shouldn't cause any issues insitemap.ts
, or any other files for that matter, just because I updatenext
to version13.4.9
.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1417
The text was updated successfully, but these errors were encountered: