godaddy / godaddy/wrhs

node-fetch@^3 is not compatible w/ this cli

Open
#42 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1
Forks
5
PR merge metrics
No merged PRs in 30d

Description

# Description

As I was attempting to publish the latest version i was getting

```bash
❯ npm publish

> wrhs@1.1.1 prepack
> oclif-dev manifest && oclif-dev readme

Error Plugin: wrhs: require() of ES Module /Users/rmarkins/dev/opensource/wrhs/node_modules/node-fetch/src/index.js from /Users/rmarkins/dev/opensource/wrhs/src/utils/request.js not supported.
Instead change the require of index.js in /Users/rmarkins/dev/opensource/wrhs/src/utils/request.js to a dynamic import() which is available in all CommonJS modules.
Code: ERR_REQUIRE_ESM
npm ERR! code 1
npm ERR! path /Users/rmarkins/dev/opensource/wrhs
npm ERR! command failed
npm ERR! command sh -c oclif-dev manifest && oclif-dev readme

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rmarkins/.npm/_logs/2022-05-05T23_09_26_028Z-debug-0.log
```

this was due to `node-fetch` no longer supporting commonjs require and being esm only. We should look to move away from this package if we continue to be commonjs only.

Contributor guide

Open the contributing guide

Research direction

Start with src/utils/request.js and the npm publish prepack command shown in the report. Reproduce the failure with npm publish, then investigate the CommonJS and ES module compatibility of the request dependency. Done means the prepack step completes without the ERR_REQUIRE_ESM error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.