vendure icon indicating copy to clipboard operation
vendure copied to clipboard

bump `node-fetch` for `@vendure/testing`

Open tianyingchun opened this issue 2 years ago • 2 comments

Describe the bug

for node v20+,The punycode module is deprecated.

(node:64859) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. at node:punycode:3:9 at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:397:7) at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10) at loadBuiltinModule (node:internal/modules/helpers:101:7) at Module._load (node:internal/modules/cjs/loader:1006:17) at Module.require (node:internal/modules/cjs/loader:1237:19) at require (node:internal/modules/helpers:176:18) at Object. (/Users/tianyingchun/Documents/coding/dress/dress-srv/node_modules/whatwg-url/lib/url-state-machine.js:2:18) at Module._compile (node:internal/modules/cjs/loader:1378:14) at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)

Expected behavior upgrade @vendure/test node-fetch to latest version

Environment (please complete the following information):

  • @vendure/core version: 2.1.7
  • Nodejs version: 21.6
  • Database (mysql/postgres etc): mysql

tianyingchun avatar Mar 03 '24 01:03 tianyingchun

Note: we are on the latest 2.x version. From their readme:

node-fetch from v3 is an ESM-only module - you are not able to import it with require().

If you cannot switch to ESM, please use v2 which remains compatible with CommonJS. Critical bug fixes will continue to be > published for v2.

Upgrading might involve some extra work due to the ESM-only format.

michaelbromley avatar Mar 04 '24 16:03 michaelbromley

can we use nodejs builtin fetch api? https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch image

tianyingchun avatar Mar 07 '24 06:03 tianyingchun