When starting in prod mode (doing next build and npm start), this error occurs when I try to navigate to the page in the browser.
When run 'next build && next export', this error occurs immediately.
yarn installnext buildyarn start or 'npm run start' / Run the 'start' script of package.jsonError: Cannot find module 'C:\...\.next\server\pages-manifest.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at getPagePath (C:\...\node_modules\next-server\dist\server\require.js:14:27)
at Object.requirePage (C:\...\node_modules\next-server\dist\server\require.js:30:22)
at Object.loadComponents (C:\...\node_modules\next-server\dist\server\load-components.js:15:34)
at Server.renderToHTMLWithComponents (C:\...\node_modules\next-server\dist\server\next-server.js:196:48)
at Server.renderToHTML (C:\...\node_modules\next-server\dist\server\next-server.js:202:37)
at Server.render (C:\...\node_modules\next-server\dist\server\next-server.js:185:33) code: 'MODULE_NOT_FOUND' }
We had had the same error with Version of Next.js: 8.0.0 and 8.0.1
Hi everybody....Any news about this?.... I need to put a implementation in production and I cant.... thanks...
Regards.... @timneutkens
Feel free to help investigate / solve the issue. 馃檹
@timneutkens the deploy function work in your stages?.... we need to know that to check the problem...because if the build-export work for you, is a different issue that if it is doesnt work.
I mean I haven't been able to even look into this issue yet. Hence why I was saying you could investigate it.
Ok @timneutkens I found a solution for next export and build ...if I put module.exports = { target: 'server'}, in next.config.js....all working fine localy..but if a try to put all in production stage in zeit-now...the logs said me that;]
Error: No serverless pages were built. https://err.sh/zeit/now-builders/now-next-no-serverless-pages-
Any idea about that?....
I'm not sure what you mean, how does that relate to this issue?
I partially solved commenting in next.congif.js on export modules target: 'serverless', that just work fine to build and start production mode on local, but if you need to deploy your site, NOW requires that target uncommented.
Remember to delete your .next folder.
My npm scripts are :
"now-build": "NODE_ENV=production next build",
"now-export": "NODE_ENV=production next start"
Jumping in to say that commenting out target: 'serverless' from my next.config.js also fixed the local build for me.
@FedeMadoery I just pulled down your repository and it appears to be working fine (build, export, and starting). I'm going to close this issue, if you are still having trouble feel free to leave a comment with more info.
I removed target: 'serverless' from the next.config file and it worked for me!
Most helpful comment
Jumping in to say that commenting out
target: 'serverless'from mynext.config.jsalso fixed the local build for me.