Open ecomonestop opened 4 years ago
The issue is that this package uses an old version of aws-amplify
, specifically this line in @aws-amplify/analytics
is causing this error.
Fixing this required replacing the old version of aws-amplify
.
yarn add aws-amplify@2.2.0
Which checks to see that navigator
is not undefined
before accessing the object property see this commit
When I run npm run build, I get the following error: failed Building static HTML for pages - 8.576s
ERROR #95312
"navigator" is not available during server side rendering.
See our docs page for more info on this error: https://gatsby.dev/debug-html
85 | var ACCEPTED_CODES = [202]; 86 | var MOBILE_SERVICE_NAME = 'mobiletargeting';
WebpackError: ReferenceError: navigator is not defined
AWSPinpointProvider.js:87 Module../node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSPinpointProvider.js node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSPinpointProvider.js:87:1
Analytics.js:1 Module../node_modules/@aws-amplify/analytics/lib-esm/Analytics.js node_modules/@aws-amplify/analytics/lib-esm/Analytics.js:1:1
index.js:1 Module../node_modules/@aws-amplify/analytics/lib-esm/index.js node_modules/@aws-amplify/analytics/lib-esm/index.js:1:1
index.js:1 Module../node_modules/aws-amplify/lib-esm/index.js node_modules/aws-amplify/lib-esm/index.js:1:1
header.js:1 Module../src/components/header.js src/components/header.js:1:1
404.js:1 Module../src/pages/404.js src/pages/404.js:1:1
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! gatsby-auth-starter-aws@1.0.0 build:
gatsby build
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the gatsby-auth-starter-aws@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\romer\AppData\Roaming\npm-cache_logs\2019-12-10T13_36_16_975Z-debug.log
Can Aws Amplify client libraries be "Node safe" to prevent this issue?