Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
  },
like image 661
user3794648 Avatar asked May 26 '21 00:05

user3794648


1 Answers

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.

like image 125
user3794648 Avatar answered Oct 17 '22 17:10

user3794648