DTS-STN / Benefits-Finder

2 stars 1 forks source link

App breaks when running main branch locally #42

Closed pcraig3 closed 3 years ago

pcraig3 commented 3 years ago

Hey all, I just trie pulling down the code and building it and got an internal server error.

Steps to reproduce:

  1. Clone a new instance of the repo
  2. npm i
  3. npm run dev
  4. Try to visit localhost:3000
In a browser iterm after running npm run dev
Screen Shot 2021-04-23 at 10 27 45 Screen Shot 2021-04-23 at 10 33 06
Here is the full stacktrace. ``` ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5 postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migration info - Using external babel configuration from /Users/paul/Desktop/dts/Benefits-Finder/.babelrc error - ./icomoon/style.css ((webpack)/css-loader/cjs.js??ref--5-oneOf-6-1!(webpack)/postcss-loader/cjs.js??ref--5-oneOf-6-2!./icomoon/style.css) TypeError: Cannot read property 'unprefixed' of undefined event - build page: /next/dist/pages/_error wait - compiling... error - ./icomoon/style.css ((webpack)/css-loader/cjs.js??ref--5-oneOf-6-1!(webpack)/postcss-loader/cjs.js??ref--5-oneOf-6-2!./icomoon/style.css) TypeError: Cannot read property 'unprefixed' of undefined at runMicrotasks () Error: Cannot find module '/Users/paul/Desktop/dts/Benefits-Finder/.next/build-manifest.json' Require stack: - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/load-components.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/api-utils.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/server/next.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/server/lib/start-server.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/cli/next-dev.js - /Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/bin/next at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15) at Function.mod._resolveFilename (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/build/webpack/require-hook.js:4:1784) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Module.require (node:internal/modules/cjs/loader:996:19) at require (node:internal/modules/cjs/helpers:92:18) at loadComponents (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/load-components.js:1:1063) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:94:5) at async DevServer.findPageComponents (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:77:257) at async DevServer.renderErrorToHTML (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:139:266) at async DevServer.render (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:75:236) at async Object.fn (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:59:580) at async Router.execute (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/router.js:25:67) at async DevServer.run (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:69:1042) at async DevServer.handleRequest (/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js:34:504) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/load-components.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/api-utils.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/next-server/server/next-server.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/server/next.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/server/lib/start-server.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/cli/next-dev.js', '/Users/paul/Desktop/dts/Benefits-Finder/node_modules/next/dist/bin/next' ] } ```
var-kyle commented 3 years ago

I am having a hard time determining what the problem is and cannot duplicate the issue.

For clarification,

s-laugh commented 3 years ago

FYI, I'm getting the same, on Windows even after updating to the latest LTS Node v14.16.1 npm v6.14.12

This was my trace ``` $ npm run dev > benefits-finder@0.1.0 dev D:\repos\Benefits-Finder > next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5 info - Using external babel configuration from D:\repos\Benefits-Finder\.babelrc event - compiled successfully event - build page: / wait - compiling... event - compiled successfully FetchError: request to http://localhost:1337/benefits failed, reason: connect ECONNREFUSED 127.0.0.1:1337 at ClientRequest. (D:\repos\Benefits-Finder\node_modules\node-fetch\lib\index.js:1461:11) at ClientRequest.emit (events.js:315:20) at Socket.socketErrorListener (_http_client.js:469:9) at Socket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:80:21) { type: 'system', errno: 'ECONNREFUSED', code: 'ECONNREFUSED' } ```
var-kyle commented 3 years ago

@s-laugh you're error is happening because you don't have the CMS running locally or you don't have a .env file with the url to the dev instance of the CMS. The two options to fix this are:

pcraig3 commented 3 years ago

A bit late here, but I am no longer able to reproduce this issue.

Steps I followed:

Note just doing npm i will cause an error.