I’ve just tried to update my node version from 6 to 8, running on AWS.
It’s working locally, but failing on AWS because one of my node module isn’t found there.
2018-06-18 16:06:03.884 (+02:00) bb41b586-7300-11e8-bf9f-5d32ca02e650 { Error: Cannot find module 'react-gtm'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/task/.next/dist/bundles/pages/index.js:975:18)
at __webpack_require__ (/var/task/.next/dist/bundles/pages/index.js:23:31)
at Object.<anonymous> (/var/task/.next/dist/bundles/pages/index.js:701:17)
at __webpack_require__ (/var/task/.next/dist/bundles/pages/index.js:23:31)
at Object.<anonymous> (/var/task/.next/dist/bundles/pages/index.js:2850:15)
at __webpack_require__ (/var/task/.next/dist/bundles/pages/index.js:23:31) code: 'MODULE_NOT_FOUND' }
END RequestId: b9d1ab7a-7300-11e8-873b-8198ee208847
...
Unable to stringify response body as json: Converting circular structure to JSON: TypeError
But it’s being correctly packaged in when I run the build:
Serverless: Packing external modules: source-map-support@0.5.3, babel-runtime@6.26.0, next@5.0.1-canary.16, react@16.2.0, react-dom@16.2.0, aws-serverless-express@3.1.3, lodash.get@4.4.2, stacktrace-js@2.0.0, express@4.16.2, express-http-proxy@1.1.0, http-proxy@1.16.2, build-url@1.0.10, moment@2.21.0, classnames@2.2.5, deepmerge@2.0.1, next-redux-wrapper@1.3.5, react-redux@5.0.7, redux@3.7.2, prop-types@15.6.1, react-gtm@github:vadorequest/react-gtm#2.0.0, react-hotjar@1.0.11, react-select@1.2.1, react-style-proptype@3.2.1, reactstrap@5.0.0-beta, recompose@0.26.0, redux-devtools-extension@2.13.2, redux-thunk@2.2.0, styled-jsx@2.2.6, useragent@2.3.0
It’s the only module I load from my own github repository, it works correctly using node 6, I just made it work by downgrading to node 6 to make sure it’s related.
Any idea how to fix this?