Skip to content

tslib is in devDependencies → Cannot find module 'tslib' when loaded as a csdx plugin #194

Description

@JvE-iO

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions