-
-
Notifications
You must be signed in to change notification settings - Fork 96
@fedify/cli 2.1.2 and 2.0.9 fail at startup because @fedify/init publishes .mjs files but exports .js #655
Description
npx -y @fedify/cli@2.1.2 fails immediately, while 2.1.1 works.
The same regression appears on the 2.0 maintenance line: @fedify/cli@2.0.9 fails, while 2.0.8 works.
Reproduction
npx -y @fedify/cli@2.1.2 --helpAlso reproducible with:
npx -y @fedify/cli@2.0.9 --helpActual result
Node fails during module resolution:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/@fedify/init/dist/mod.js'
imported from '.../node_modules/@fedify/cli/dist/init/mod.js'Expected result
The CLI should start normally and print help output, as it does with:
npx -y @fedify/cli@2.1.1 --help
npx -y @fedify/cli@2.0.8 --helpSuspected cause
This looks like a packaging regression introduced in the releases that also contained the tsdown upgrade for fixing #651.
From the published packages:
@fedify/init@2.1.2and@fedify/init@2.0.9containdist/mod.mjsanddist/mod.d.mts- but their
package.jsonstill pointsmain/exports.import/typesto./dist/mod.jsand./dist/mod.d.ts
So @fedify/cli imports @fedify/init, Node resolves through @fedify/init's export map, and then fails because dist/mod.js does not actually exist in the published tarball.
That also explains why even fedify --help fails: the CLI imports its init module eagerly during startup.
Notes
The issue seems specific to the published npm artifacts, not to the CLI command logic itself.
The relevant version boundary is:
- working:
@fedify/cli@2.1.1,@fedify/init@2.1.1 - broken:
@fedify/cli@2.1.2,@fedify/init@2.1.2
and likewise:
- working:
@fedify/cli@2.0.8,@fedify/init@2.0.8 - broken:
@fedify/cli@2.0.9,@fedify/init@2.0.9