-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Description
What is the problem this feature will solve?
The ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING arises if you import a TypeScript file from another package. I understood this is to discourage having TypeScript-only packages. However, this also applies to private packages, where the organization decides whether a TS-only ecosystem fits for them. This is particularly annoying in monorepos, where imports are local, because it forces you to build the changed package before using it instead of changes just propagating naturally.
What is the feature you are proposing to solve the problem?
We could have an opt-in flag, environment variable, or package.json field that enables type stripping in node_modules. In this way, we keep discouraging TypeScript-only public packages, while allowing their usage in contexts where it makes sense.
What alternatives have you considered?
-
pnpm Workspaces: In a monorepo, pnpm symlinks local packages, so development works fine. But when building an artifact (like a container image),
pnpm prunecopies local packages intonode_modules, forcing you to copy the entire monorepo—which increases the artifact size. -
Turbo.build: Turbo lets you selectively copy only the necessary packages, avoiding the need to hardcode local packages in
node_modules. The trade-off is that it introduces extra tooling and only works in monorepos; using local packages from cloned repositories still poses challenges (TS in development vs. JS in builds). -
File Watcher: A file watcher can rebuild changed dependencies and restart the server on file changes. However, this requires complex logic for monitoring files and managing dependencies.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status