0

I have a weird issue that I think has to do with source maps. Every now and then, I can see in the Terminal that drawer.css.map gets passed as the value of the id prop into my Page server component, and into my generateMetadata function.

This is accompanied by the following warning in Chrome Dev Tools:

DevTools failed to load source map: Could not load content for http://localhost:3000/users/drawer.css.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

I do not believe that I am the one causing this. I am not sure if it is caused by Next.js, or by Chrome.

My page file (src/app/users/[id]/page.tsx):

export async function generateMetadata(
    { params: { id } }: { params: { id: string } }
) {
    // ...
}

export default async function Page(
    { params: { id } }: { params: { id: string } }
) {
    // ...
} 
Ben
  • 15,938
  • 19
  • 92
  • 138
  • Are you using WP Joli? A similar issue was discussed in https://wordpress.org/support/topic/devtools-failed-to-load-source-map-9/ – TheDeafOne Jul 07 '23 at 12:13
  • No, I'm using Next.js. Is WP Joli a WordPress plug-in, or is it a browser extension? – Ben Jul 08 '23 at 08:54
  • It's a WordPress plug-in, but this does lead me to think your problem is similar to the one described here: I've got similar issues before. It's similar to this thread: https://stackoverflow.com/questions/61339968/error-message-devtools-failed-to-load-sourcemap-could-not-load-content-for-chr It's a chrome issue, and you can just disable source-maps to ignore it. – TheDeafOne Jul 09 '23 at 17:03

0 Answers0