Routing Error
Unanswered
Brittany posted this in #help-forum
BrittanyOP
Unhandled Runtime Error
Error: Failed to parse URL from /api/xxxxxx
Error: Failed to parse URL from /api/xxxxxx
4 Replies
Crazy ant
If you are using app router version then you need to use absolute URLs,
const response = await fetch(${process.env.NEXT_PUBLIC_BASE_URL}/"your route"`)@Crazy ant If you are using app router version then you need to use absolute URLs, `const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/"your route"`)
Yes but no, do not fetch your route handlers inside server components
@Crazy ant If you are using app router version then you need to use absolute URLs, `const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/"your route"`)
BrittanyOP
Thank you very much, by app router you mean app directory? I’ll try this out!