This error occurs when the frontend is being run without access to the API.
yarn run v1.19.1
$ concurrently --kill-others "yarn start-prod"
$ cross-env NODE_PATH=src NODE_ENV=production PORT=8080 APIHOST='https://api.cozy.nyc' node ./bin/server.js
[0] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
[0] ----
[0] ==> โ
https://api.cozy.nyc is running, talking to API server on %s.
[0] ==> ๐ป Open http://0.0.0.0:8080 in a browser to view the app.
[0] proxy error { Error: connect ECONNREFUSED 204.48.27.157:443
[0] at Object._errnoException (util.js:1022:11)
[0] at _exceptionWithHostPort (util.js:1044:20)
[0] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
[0] code: 'ECONNREFUSED',
[0] errno: 'ECONNREFUSED',
[0] syscall: 'connect',
[0] address: '204.48.27.157',
[0] port: 443 }
[0] GET / 200 40.637 ms - -
[0] GET /dist/main-fd82e1283f0db20fc3e5.css 200 5.412 ms - -
[0] GET /dist/main-fd82e1283f0db20fc3e5.js 200 2.533 ms - -
[0] proxy error { Error: connect ECONNREFUSED 204.48.27.157:443
[0] at Object._errnoException (util.js:1022:11)
[0] at _exceptionWithHostPort (util.js:1044:20)
[0] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
[0] code: 'ECONNREFUSED',
[0] errno: 'ECONNREFUSED',
[0] syscall: 'connect',
[0] address: '204.48.27.157',
[0] port: 443 }
[0] GET /dist/about-8f1583eb76f278cbbe2d.chunk.js 200 2.947 ms - -
[0] proxy error { Error: connect ECONNREFUSED 204.48.27.157:443
[0] at Object._errnoException (util.js:1022:11)
[0] at _exceptionWithHostPort (util.js:1044:20)
[0] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
[0] code: 'ECONNREFUSED',
[0] errno: 'ECONNREFUSED',
[0] syscall: 'connect',
[0] address: '204.48.27.157',
[0] port: 443 }
[0] POST /api/auth/token/verify/ 500 4.438 ms - -
[0] GET /dist/0a89072fbfe9c6e7e38d01808b003178.gif 200 2.312 ms - 538943
[0] proxy error { Error: connect ECONNREFUSED 204.48.27.157:443
[0] at Object._errnoException (util.js:1022:11)
[0] at _exceptionWithHostPort (util.js:1044:20)
[0] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
[0] code: 'ECONNREFUSED',
[0] errno: 'ECONNREFUSED',
[0] syscall: 'connect',
[0] address: '204.48.27.157',
[0] port: 443 }
[0] POST /api/auth/token/verify/ 500 6.060 ms - -
[0] MOUNT ERROR: TypeError: Converting circular structure to JSON
[0]
[0] - JSON.stringify
[0]
[0] - index.js:78 serialize
[0] [cozy-nyc]/[serialize-javascript]/index.js:78:20
[0]
[0] - Html.js:63 Html
[0] /var/www/cozy-nyc/src/helpers/Html.js:63:66
[0]
[0] - react-dom-server.node.production.min.js:28 d
[0] [cozy-nyc]/[react-dom]/cjs/react-dom-server.node.production.min.js:28:492
[0]
[0] - react-dom-server.node.production.min.js:30 ua
[0] [cozy-nyc]/[react-dom]/cjs/react-dom-server.node.production.min.js:30:494
[0]
[0] - react-dom-server.node.production.min.js:35 a.render
[0] [cozy-nyc]/[react-dom]/cjs/react-dom-server.node.production.min.js:35:48
[0]
[0] - react-dom-server.node.production.min.js:34 a.read
[0] [cozy-nyc]/[react-dom]/cjs/react-dom-server.node.production.min.js:34:288
[0]
[0] - react-dom-server.node.production.min.js:45 Object.renderToString
[0] [cozy-nyc]/[react-dom]/cjs/react-dom-server.node.production.min.js:45:6
[0]
[0] - server.js:187 renderToString
[0] /var/www/cozy-nyc/src/server.js:187:53
[0]
[0] - runtime.js:62 tryCatch
[0] [cozy-nyc]/[runtime-corejs2]/[regenerator-runtime]/runtime.js:62:40
[0]
[0]
[0] events.js:183
[0] throw er; // Unhandled 'error' event
[0] ^
[0]
[0] TypeError: Converting circular structure to JSON
[0] at JSON.stringify (<anonymous>)
[0] at serialize (/var/www/cozy-nyc/node_modules/serialize-javascript/index.js:78:20)
[0] at Html (/var/www/cozy-nyc/src/helpers/Html.js:63:66)
[0] at d (/var/www/cozy-nyc/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:28:492)
[0] at ua (/var/www/cozy-nyc/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:30:494)
[0] at a.render (/var/www/cozy-nyc/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:35:48)
[0] at a.read (/var/www/cozy-nyc/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:34:288)
[0] at b._read (/var/www/cozy-nyc/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:401)
[0] at b.Readable.read (_stream_readable.js:442:10)
[0] at resume_ (_stream_readable.js:822:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[0] yarn start-prod exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This is most likely due to the API calls being made and returning with a 500. The frontend shouldn't require the backend to run. Exceptions need to be added to prevent the site from crashing.