Closed privatenumber closed 4 years ago
Merging #121 into dev will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## dev #121 +/- ##
=======================================
Coverage 97.18% 97.18%
=======================================
Files 1 1
Lines 71 71
Branches 39 39
=======================================
Hits 69 69
Misses 2 2
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4ef88e4...cccff9d. Read the comment docs.
Hi @privatenumber and thanks for pull-request :+1:
There is a strategy called interopDefault which we can do something like this:
const _interopDefault = (ex) => ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex
const fetch = _interopDefault(require('node-fetch'))
Updated
Actually, there's another bug. It expects the CJS version
We'd have to either add a complicated named exports interop, or explicitly import the CJS version like it did before.
Sorry, noticed you approved it so had to comment quick before the merge
Actually, there's another bug. It expects the CJS version
@privatenumber Would you please elaborate more? What's the error with latest change?
@pi0 Updated my comment
Thank you @pi0 🔥
Using
@nuxt/http
on Vercel via@nuxtjs/now-builder
and was getting the following error on the server-side:I added a
console.log(fetch);
(as you can see above) and it was importing the ESM version (node-fetch/lib/index.es.js
). I specified the specific CJS build explicitly.