You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seen after pulling latest master - I suspect a571938.
Stacktrace
node on git:master ❯ g node land 40757 12:11PMTypeError: fetch is not a function at wrappedFetch (/Users/codebytere/Developer/node-core-utils/lib/request.js:17:10) at Request.fetch (/Users/codebytere/Developer/node-core-utils/lib/request.js:37:12) at Request.text (/Users/codebytere/Developer/node-core-utils/lib/request.js:45:17) at Request.json (/Users/codebytere/Developer/node-core-utils/lib/request.js:50:29) at Request.query (/Users/codebytere/Developer/node-core-utils/lib/request.js:108:31) at Request.gql (/Users/codebytere/Developer/node-core-utils/lib/request.js:68:33) at LandingSession.warnForWrongBranch (/Users/codebytere/Developer/node-core-utils/lib/landing_session.js:486:65) at main (/Users/codebytere/Developer/node-core-utils/components/git/land.js:175:21) at processTicksAndRejections (node:internal/process/task_queues:96:5)
@targos yes, and removed node_modules beforehand to be doubly sure! Using Node.js v16.2.0.
Update - installed v16.13.0 locally and it worked - we should probably error or specify somewhere the base version one now needs to run node-core-utils 🤔
That is strange, but I believe Undici fetch is still considered experimental even on node 16. Best to stick to node-fetch for now. I can take a closer look later on as well
Activity
targos commentedon Nov 17, 2021
Did you run
npm install?codebytere commentedon Nov 17, 2021
@targos yes, and removed
node_modulesbeforehand to be doubly sure! Using Node.jsv16.2.0.Update - installed
v16.13.0locally and it worked - we should probably error or specify somewhere the base version one now needs to runnode-core-utils🤔targos commentedon Nov 17, 2021
Oh wow, it looks like
undicidoesn't always export afetchfunction:I thought it would be a good idea to use the module to give it some real world test coverage...
@nodejs/undici
targos commentedon Nov 17, 2021
We should probably go back to
node-fetch.undici.fetchdoesn't work on the latest version of Node.js 14ronag commentedon Nov 17, 2021
We only export fetch for node >= 16.5 since we depend on web streams
Ethan-Arrowood commentedon Nov 17, 2021
That is strange, but I believe Undici fetch is still considered experimental even on node 16. Best to stick to node-fetch for now. I can take a closer look later on as well
codebytere commentedon Nov 17, 2021
@targos yeah i did see that i docs here - i can open a PR to revert if that's the path forward!
targos commentedon Nov 17, 2021
Go ahead! I removed node-fetch because version 3.x doesn't support commonjs, so you'll have to stay with version 2.x.
codebytere commentedon Nov 17, 2021
Done: #595