Quantcast
Channel: Nextjs export gives Cannot find module for page - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Nextjs export gives Cannot find module for page

$
0
0

Hi I just started playing around with nextjs to see if it fits my use case. I wanted to export the site with some dynamic routes.

My pages folder structure is like below

page  locales    [locale]      [slug].js

When I run next develop I can access the page at http://localhost:3000/locales/de-DE/summer-dress-f.

So now im trying to export the page with next.config.js like

module.exports = {  exportPathMap: function() {    return {"/locales/de-DE/summer-dress-f": {        page: "/locales",        query: { locale: "de-DE", slug: "summer-dress-f" }      }    };  }};

next build runs fine but when I run next export I get the error

Error: Cannot find module for page: /locales    at pageNotFoundError (/Users/bmathew/Desktop/workspace/next-demo/node_modules/next-server/dist/server/require.js:13:17)

Any ideas what am I missing here?


Viewing all articles
Browse latest Browse all 11

Latest Images

Trending Articles





Latest Images