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
{{ message }}
Repository navigation
commandkit/events throws SyntaxError (export in .cjs) and commandkit/cli points to a missing cli.cjs #643
Two exported subpaths in commandkit fail to load at runtime in both ESM and CommonJS: commandkit/events throws SyntaxError: Unexpected token 'export', and commandkit/cli fails with ERR_MODULE_NOT_FOUND / MODULE_NOT_FOUND because cli.cjs is missing from the package.
(node:3517984) Warning: Failed to load the ES module: /path/to/repro/node_modules/commandkit/events.cjs. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
commandkit/events -> SyntaxError: Unexpected token 'export'
commandkit/cli -> Error: Cannot find module '/path/to/repro/node_modules/commandkit/cli.cjs' imported from /path/to/repro/repro.mjs
require('commandkit/events') and require('commandkit/cli') fail the same way because exports["./events"] and exports["./cli"] map both import and require to ./events.cjs and ./cli.cjs. Both events.d.ts and cli.d.ts are published, so TypeScript compilation succeeds and the failure only appears at runtime.
Expected: commandkit/events exports { useEvents }, and commandkit/cli exports { development, production, env, cli, compiler, appProcess, typeChecker, utilities } as documented in apps/website/docs/guide/08-advanced/05-using-cli-api.mdx.
In packages/commandkit/events.cjs, require('./dist/context/async-context.js') is paired with export function useEvents() instead of module.exports = { useEvents }, and packages/commandkit/package.json lists ./cli.cjs in exports["./cli"] and files while the wrapper in the repository is named packages/commandkit/cli.js (so cli.cjs is neither resolved on main nor included in the published tarball).
Tested on commandkit@1.2.6 (npm latest, with discord.js@14.25.1) and main (e65f243) with Node.js v26.13.0.
Activity