microsoft/rushstack

[heft] `ERR_ILLEGAL_CONSTRUCTOR` when running `heft clean`

Niek opened this issue · 3 comments

Niek commented

See below:

❯ node -v
v20.7.0
❯ npx heft clean
TypeError [ERR_ILLEGAL_CONSTRUCTOR]: Illegal constructor
Question Answer
@rushstack/heft version? v0.61.0
Operating system? macOS
Would you consider contributing a PR? Yes
Node.js version (node -v)? v20.7.0

The Heft package's full name is @rushstack/heft.

If you already have Heft installed locally (i.e. - this is actually running our Heft), can you provide a stacktrace?

Niek commented

Yes, this is when heft is installed locally. The error was introduced in heft v0.60.0, v0.59.0 is working fine. To reproduce:

$ mkdir -p test/config && cd test
$ echo '{ "name": "test", "version": "0.0.0" }' > package.json
$ echo '{"$schema":"https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json","phasesByName":{"build":{"cleanFiles":[{"sourcePath":"dist"},{"sourcePath":"lib"}]}}}' > config/heft.json
$ npx -y @rushstack/heft@0.60.0 clean
TypeError [ERR_ILLEGAL_CONSTRUCTOR]: Illegal constructor

This has been fixed in @rushstack/heft v0.61.3.