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
[Bug?]: TypeScript 7 RC fails to install because the legacy TypeScript compat patch targets removed JS compiler files #7191
Installing [email protected] with Yarn fails because the built-in TypeScript compatibility patch is still applied to TypeScript 7. The patch was designed for the legacy JS compiler package layout and includes hunks for files such as lib/_tsc.js, which no longer exist in the TypeScript 7 native compiler package.
This should be addressed by: microsoft/typescript-go#1966
ENOENT: no such file or directory, lstat '/node_modules/typescript/lib/_tsc.js'
Expected Behavior
Yarn should not apply the legacy JS TypeScript compat patch to TypeScript 7, since TypeScript 7 uses the new native compiler package layout.
Reacted by Mitch Ryan, Julian Waller, Max Netterberg, richardasymmetric, Kyle, Ben Cook, Fredrik Adelöw, João Pedro Schmitz, Julien Roncaglia, Jiri Zbytovsky and 14 more
Temporary workaround that unblocked us on a nodeLinker: node-modules setup.
Since we don't use PnP, we don't need the TypeScript compat patch semantically; we only needed to prevent Yarn from rewriting the typescript descriptor to patch:...builtin<compat/typescript>, because the TS 7 RC package no longer has the JS compiler files that the legacy patch expects.
After that, yarn up typescript@rc resolved to plain typescript@npm:7.0.1-rc and installs/checks worked again. This is definitely a workaround rather than a fix, but it may be useful for other node-modules projects that don't rely on Yarn's PnP TypeScript patch.
Reacted by Clayton Davis, Abhi Agarwal, Max Netterberg, Jiri Zbytovsky and Vincent Taverna
Thanks @wojtekmaj for the workaround, I think my PR #7190 limiting the patch version should also be safe to land and unblock nodeLinker: node-modules fleet.
Amazing, thanks for this workaround. I'd solved it by patching the compat package to add the missing files as re-export stubs, but disabling the patch via a plugin is much cleaner, so I've switched to it.
I'll follow this thread until @hamidrezahanafi's PR (#7190) lands, since gating the builtin patch is the cleanest proper fix.
One caveat though: as written it bounds the patch to TS < 7, which fixes installing [email protected] directly but not the recommended TS6/TS7 side-by-side setup, where typescript is aliased to @typescript/typescript6 (a 6.x shim that is still < 7 and lacks the patched files, so it keeps failing).
I left a remark on the PR with a repro and two options to cover that case too. @hamidrezahanafi would you be open to extending it?
abhi-airspace-intelligence commented on Jun 19, 2026
Temporary workaround that unblocked us on a nodeLinker: node-modules setup.
Since we don't use PnP, we don't need the TypeScript compat patch semantically; we only needed to prevent Yarn from rewriting the typescript descriptor to patch:...builtin<compat/typescript>, because the TS 7 RC package no longer has the JS compiler files that the legacy patch expects.
path: .yarn/plugins/plugin-disable-typescript-compat.cjs
spec: "plugin-disable-typescript-compat"
After that, yarn up typescript@rc resolved to plain typescript@npm:7.0.1-rc and installs/checks worked again. This is definitely a workaround rather than a fix, but it may be useful for other node-modules projects that don't rely on Yarn's PnP TypeScript patch.
Note this is subtly wrong if you rely on immutable installs in your CI: this is what fixed it for me:
Activity
wojtekmaj commentedon Jun 18, 2026
Temporary workaround that unblocked us on a
nodeLinker: node-modulessetup.Since we don't use PnP, we don't need the TypeScript compat patch semantically; we only needed to prevent Yarn from rewriting the
typescriptdescriptor topatch:...builtin<compat/typescript>, because the TS 7 RC package no longer has the JS compiler files that the legacy patch expects.We added this local plugin:
And registered it before other plugins:
After that,
yarn up typescript@rcresolved to plaintypescript@npm:7.0.1-rcand installs/checks worked again. This is definitely a workaround rather than a fix, but it may be useful for othernode-modulesprojects that don't rely on Yarn's PnP TypeScript patch.hamidrezahanafi commentedon Jun 18, 2026
Thanks @wojtekmaj for the workaround, I think my PR #7190 limiting the patch version should also be safe to land and unblock
nodeLinker: node-modulesfleet.wojtekmaj commentedon Jun 18, 2026
And your solution is undeniably better! Except for one detail: it needs to be released. I'm too eager to try the RC out to wait 😁
maik-bol commentedon Jun 18, 2026
Amazing, thanks for this workaround. I'd solved it by patching the compat package to add the missing files as re-export stubs, but disabling the patch via a plugin is much cleaner, so I've switched to it.
I'll follow this thread until @hamidrezahanafi's PR (#7190) lands, since gating the builtin patch is the cleanest proper fix.
One caveat though: as written it bounds the patch to TS < 7, which fixes installing
[email protected]directly but not the recommended TS6/TS7 side-by-side setup, wheretypescriptis aliased to@typescript/typescript6(a6.xshim that is still < 7 and lacks the patched files, so it keeps failing).I left a remark on the PR with a repro and two options to cover that case too. @hamidrezahanafi would you be open to extending it?
abhi-airspace-intelligence commentedon Jun 19, 2026
Note this is subtly wrong if you rely on immutable installs in your CI: this is what fixed it for me:
maik-bol commentedon Jun 19, 2026
We do rely on immutable installs, but everything seemed right, thanks for this but what does it exactly subtly fix?
build: use @typescript/native-preview tsgo binary for ttsc (avoids ya…
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
build(core-typings,ui-kit): move typia emit to ttsc for TS7
feat!: audit fixes, React 18+, story gallery tests, Vite build and tr…
chore: update typescript to 7.0.2
Upgrade Yarn to support TypeScript 7
Bump dev dependencies (#721)