tslib is in devDependencies → Cannot find module 'tslib' when loaded as a csdx plugin
Repo: contentstack/launch-cli — package @contentstack/cli-launch
The compiled dist require("tslib") at runtime, but tslib is in devDependencies, not
dependencies. When @contentstack/cli-launch is installed as a plugin of @contentstack/cli,
its devDependencies aren't installed, so tslib is missing and every launch command fails to
load.
Repro:
pnpm add -g @contentstack/cli
csdx launch --help
→ wall of [MODULE_NOT_FOUND] ... Cannot find module 'tslib' for launch, launch:deployments,
launch:environments, launch:functions, launch:logs, launch:open, launch:rollback.
Confirmed from the registry:
$ curl -s https://registry.npmjs.org/@contentstack/cli-launch/1.11.1 | jq '{dep:.dependencies.tslib, dev:.devDependencies.tslib}'
{ "dep": null, "dev": "^2.8.1" }
npm users mostly dodge it because flat node_modules hoists tslib from some other package; a
strict pnpm install surfaces it. Not OS-specific.
Fix: move tslib from devDependencies to dependencies in package.json (or set
importHelpers: false in tsconfig so no runtime tslib is emitted).
Env: cli-launch 1.11.1 (via @contentstack/cli 1.64.0), @oclif/core 4.11.11, pnpm 11.9.0, node 23.9.0.
tslibis in devDependencies →Cannot find module 'tslib'when loaded as a csdx pluginRepo: contentstack/launch-cli — package
@contentstack/cli-launchThe compiled
distrequire("tslib")at runtime, buttslibis in devDependencies, notdependencies. When
@contentstack/cli-launchis installed as a plugin of@contentstack/cli,its devDependencies aren't installed, so
tslibis missing and everylaunchcommand fails toload.
Repro:
→ wall of
[MODULE_NOT_FOUND] ... Cannot find module 'tslib'forlaunch,launch:deployments,launch:environments,launch:functions,launch:logs,launch:open,launch:rollback.Confirmed from the registry:
npm users mostly dodge it because flat node_modules hoists
tslibfrom some other package; astrict pnpm install surfaces it. Not OS-specific.
Fix: move
tslibfromdevDependenciestodependenciesinpackage.json(or setimportHelpers: falsein tsconfig so no runtimetslibis emitted).Env: cli-launch 1.11.1 (via @contentstack/cli 1.64.0), @oclif/core 4.11.11, pnpm 11.9.0, node 23.9.0.