user3794648
user3794648

Reputation: 483

React/Next app keeps giving me an error about missing prerender-manifest.json

I have an application that is a combination of a node middleware server and a next.js front end gui with react components. It was running ok, but then, when I tried to build it in production mode, I keep getting the following error:

 UnhandledPromiseRejectionWarning: Error: Cannot find module 'C:\Users\mgardner\workspace\qa-tool-backoffice\.next\prerender-manifest.json'
Require stack:
- C:\Users\mgardner\workspace\qa-tool-backoffice\node_modules\next\dist\next-server\server\next-server.js
- C:\Users\mgardner\workspace\qa-tool-backoffice\node_modules\next\dist\server\next.js
- C:\Users\mgardner\workspace\qa-tool-backoffice\server.js

I'm a little confused as to how to get the next front end to run concurrently with the node/express server. Here's my package.json file:

{
  "name": "ibo-ui",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "mockdb": "json-server --watch public/mockdb.json --port 3001",
    "dev": "concurrently --kill-others  \"json-server --watch public/mockdb.json --port 3001\"   \"npm start\"",
    "build": "next build",
    "start": "node server.js  && next start"
  },

Upvotes: 13

Views: 21751

Answers (3)

Abhishek
Abhishek

Reputation: 1120

I had the same issue. Later, I found that there were some error in one of the page and the build process was not completed!

After executing build command,I was getting error like this:

`Export encountered errors on following paths:
/route-name/page: /route-name`

Upvotes: 0

Adi
Adi

Reputation: 11

The issue was that my pages not generated at build time in Nextjs correctly due my path included not correctly try to check your page collecting data fully and pages generated correctly.

Upvotes: 0

user3794648
user3794648

Reputation: 483

The reason this was happening was because my next build process was failing. It was failing because I had some old react functions in the public pages folder.

Upvotes: 8

Related Questions