Hi all, fresh sst serverless typescript install, i...
# help
c
Hi all, fresh sst serverless typescript install, it seems that using node-fetch: ^3.0.0 causes an error at build. Error [ERR_REQUIRE_ESM]: require() of ES Module [….]/_trials/sst-ts/node_modules/node-fetch/src/index.js from [….]/_trials/sst-ts/node_modules/@serverless-stack/core/dist/telemetry/post-payload.js not supported. Instead change the require of index.js in [….]//_trials/sst-ts/node_modules/@serverless-stack/core/dist/telemetry/post-payload.js to a dynamic import() which is available in all CommonJS modules. Any idea how to fix this ?
t
Can I see your code where you're importing node-fetch
c
Hi, I am not yet importing it, it seems that it is related to the telemetry part of serverless-stack in node_modules: @serverless-stack-slack/core/dist/telemetry/post-payload.js
It is related to telemetry: npx sst telemetry raise this error
@thdxr Ok, seems I am not the only one facing the telemetry/node-fetch3 issue according to previous slack post on 14th from @Ross Gerbasi
t
We dropped node-fetch from our deps