You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the project, then click on one of links. When returning back you'll be met with an unknown error
You could also move the folders robots.txt and sitemap.xml and run the next build It will give this error :
TypeError: Cannot read properties of undefined (reading '')
TypeError: Cannot read properties of undefined (reading '')
at Va (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1205:56)
at Ma (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1335:50)
at Array.toJSON (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1066:32)
at stringify ()
at Ua (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1393:53)
at Qa (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1185:35)
at ping (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1194:32)
TypeError: Cannot read properties of undefined (reading '')
at Va (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1205:56)
at Ma (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1335:50)
at Object.toJSON (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1066:32)
at stringify ()
at Ua (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1393:53)
at Qa (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1185:35)
at ping (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1194:32)
TypeError: Cannot read properties of undefined (reading '')
at Va (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1205:56)
at Ma (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1335:50)
at Array.toJSON (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1066:32)
at stringify ()
at Ua (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1393:53)
at Qa (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1185:35)
at ping (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1194:32)
TypeError: Cannot read properties of undefined (reading '')
at Va (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1205:56)
at Ma (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1335:50)
at Array.toJSON (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1066:32)
at stringify ()
at Ua (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1393:53)
at Qa (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1185:35)
at ping (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1194:32)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading '')
at Va (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1205:56)
at Ma (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1335:50)
at Array.toJSON (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1066:32)
at stringify ()
at Ua (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1393:53)
at Qa (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1185:35)
at ping (file:///home/projects/github-t3cgzq/.next/server/chunks/869.js:1194:32)
Describe the Bug
When using robots.txt/route.ts or sitemap.xml/route.ts next give an error in dev and in build.
One weird thing is that if we move these files into (goup)/robots.txt/route.ts and (goup)/sitemap.xml/route.ts, in dev it will give us an error but on prod, it will work fine.
It seems like there is a conflict between the metadata generation and these routes.
Expected Behavior
next should not throw an error when using robots.txt or sitemap.xml as route handlers, if this is a legit error, then. maybe throw a more descriptive error.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered:
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
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Feb 15 2023 15:52:38 GMT+0100 (Central European Standard Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.1.7-canary.15
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://stackblitz.com/edit/github-t3cgzq
To Reproduce
Run the project, then click on one of links. When returning back you'll be met with an unknown error
You could also move the folders
robots.txt
andsitemap.xml
and run thenext build
It will give this error :TypeError: Cannot read properties of undefined (reading '')
Describe the Bug
When using
robots.txt/route.ts
orsitemap.xml/route.ts
next give an error in dev and in build.One weird thing is that if we move these files into
(goup)/robots.txt/route.ts
and(goup)/sitemap.xml/route.ts
, in dev it will give us an error but on prod, it will work fine.It seems like there is a conflict between the metadata generation and these routes.
Expected Behavior
next should not throw an error when using
robots.txt
orsitemap.xml
as route handlers, if this is a legit error, then. maybe throw a more descriptive error.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: