Title: Allow type stripping in pnpm deploy monorepos · Issue #61793 · nodejs/node · GitHub
Open Graph Title: Allow type stripping in pnpm deploy monorepos · Issue #61793 · nodejs/node
X Title: Allow type stripping in pnpm deploy monorepos · Issue #61793 · nodejs/node
Description: What is the problem this feature will solve? node.js supports running a subset of typescript nativly, but for reasons doesn't allow this feature for files in node_modules. A positive caveat is that node wants to support npm workspaces, w...
Open Graph Description: What is the problem this feature will solve? node.js supports running a subset of typescript nativly, but for reasons doesn't allow this feature for files in node_modules. A positive caveat is that...
X Description: What is the problem this feature will solve? node.js supports running a subset of typescript nativly, but for reasons doesn't allow this feature for files in node_modules. A positive caveat is ...
Opengraph URL: https://github.com/nodejs/node/issues/61793
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow type stripping in pnpm deploy monorepos","articleBody":"### What is the problem this feature will solve?\n\nnode.js supports running a subset of typescript nativly, but for _reasons_ doesn't allow this feature for files in node_modules.\n\nA positive caveat is that node wants to support npm workspaces, where local sub packages are required thru node_modules. To do so it checks the real path of the file, and will type strip it if it's not within node_modules.\n\nThis also works in pnpm workspaces, but breaks in `pnpm deploy`. [This repo demonstrates that behavior.](https://github.com/everett1992/pnpm-node-type-stripping)\n\nRead or run `repro.sh` steps to reproduce.\n\nThis difference between workspace and deploy structure\n```\nbin/node_modules/lib -\u003e ../../lib\nout/node_modules/lib -\u003e .pnpm/lib@file++++lib/node_modules/lib\n```\n\ncause this error in out/index.ts, but not bin/index.ts\n\n```\nError [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for \"file:///out/node_modules/.pnpm/lib@file++++lib/node_modules/lib/index.ts\"\n```\n\nThis would also break in npm, pnpm and other dependency managers that use `install-links` or other steps that indirect the workspace dependencies into node_modules.\n\n\n### What is the feature you are proposing to solve the problem?\n\nEither remove the node_modules restriction, add more detection's for 'local node_modules' cases - such as private: true or a new marker, or establish export conditions for type stripping.\n\nI am okay with emitting `.js` and using it in my deployed app, but I want to use `.ts` in development, and I don't want dev tools to require possibly stale `.js` files.\n\nI think a reasonable solution is an export condition for 'type stripping not supported' that node would use to fallback to .js instead of erroring.\n\n```\n\"exports\": {\n \"unsupportedTypeStripping\": \"out/index.js\",\n \"default\": \"src/index.ts\",\n}\n```\n \n\n### What alternatives have you considered?\n\n_No response_","author":{"url":"https://github.com/everett1992","@type":"Person","name":"everett1992"},"datePublished":"2026-02-12T20:18:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/61793/node/issues/61793"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cac13076-bf6e-c1e9-9ebe-0bbc98bbc2b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A282:E21F7:EB8D2A:F0BE09:6A4DC3A2 |
| html-safe-nonce | cf3551b2767bcd78f065942b9548318b278092a11985e24fa583e6a0c815aec2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjgyOkUyMUY3OkVCOEQyQTpGMEJFMDk6NkE0REMzQTIiLCJ2aXNpdG9yX2lkIjoiMzIzMDU4ODAxNzE1NzQ1NjgwMiIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | fe7d97a3586214e1cd3f03fdf9ae701c2854265e2e128c71d3e0bb4fedc2dd25 |
| hovercard-subject-tag | issue:3933825087 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/61793/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ffca718128a696b4308c43933b8fe06b699d89830a8238744659b3fedddd28f1/nodejs/node/issues/61793 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ffca718128a696b4308c43933b8fe06b699d89830a8238744659b3fedddd28f1/nodejs/node/issues/61793 |
| og:image:alt | What is the problem this feature will solve? node.js supports running a subset of typescript nativly, but for reasons doesn't allow this feature for files in node_modules. A positive caveat is that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | everett1992 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width