Closed huozhi closed 1 year ago
in isomorphic-fetch/node.mjs it's destruction fetch function from node-fetch to get other exports like Request
isomorphic-fetch/node.mjs
node-fetch
Request
import fetch from "node-fetch"; const { Request, Response, Headers } = fetch; export { fetch, Request, Response, Headers };
But new version of node-fetch is a esm module now which doesn't contain those exports on fetch function. Need to chanage to import/export destruction expression to get them
- import fetch from "node-fetch"; - const { Request, Response, Headers } = fetch; - export { fetch, Request, Response, Headers }; + export { default as fetch, Request, Response, Headers } from 'node-fetch'
Related issue on next.js: https://github.com/vercel/next.js/issues/51309
Close this as it should be on isomorphic-ts side, re-post here
in
isomorphic-fetch/node.mjs
it's destruction fetch function fromnode-fetch
to get other exports likeRequest
But new version of node-fetch is a esm module now which doesn't contain those exports on fetch function. Need to chanage to import/export destruction expression to get them
Related issue on next.js: https://github.com/vercel/next.js/issues/51309