Next.js Discord

Discord Forum

Routing Error

Unanswered
Brittany posted this in #help-forum
Open in Discord
BrittanyOP
Unhandled Runtime Error
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"`)
BrittanyOP
Thank you very much, by app router you mean app directory? I’ll try this out!