Search code examples
node.jsnext.jsvercel

Next deploy via Vercel: found pages without a React Component as default export in


When I deploy my Nextjs app I get a buid err. Vercel doesn`t see nested pages. How can I override it, maybe it is posible in vercel.json?

Building logs building logs

Project structure

project structure

I tried this, but it`s breaks everything

module.exports = {
    pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js']
}

Solution

  • Could you try moving your components outside pages folder as Next.js has a file-system based router built on the concept of pages.

    Hope you should be using export default instead of export inside index.tsx for exporting your component.