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
Typescript 5.6.3 throwing error "The inferred type of X cannot be named without a reference to Y. This is likely not portable. A type annotation is necessary."Β #60214
// Your code hereimport{makeStyles}from"tss-react/mui";// this doesn't workconstPPCTableStyle=makeStyles()({});exportdefaultPPCTableStyle;
π Actual behavior
We have been using typescript v5.5.4 in our project and I wanted to upgrade to v5.6.3(latest). On attempt, the code sample above had a typescript error "The inferred type of 'PPCTableStyle' cannot be named without a reference to '../node_modules/tss-react/types'. This is likely not portable. A type annotation is necessary."
This has been working previously but since 5.5.4->5.6.*, it stopped working and threw this error.
π Expected behavior
I'm expecting this code snippet to work since it has been previously working on earlier versions
Additional information about the issue
We are working in a monorepo and use pnpm version manager. However I was able to repro via yarn in a non-monorepo environment.
Activity
ritschwumm commentedon Oct 13, 2024
multiple versions of the same dependency, maybe? iirc that can cause this error..
RyanCavanaugh commentedon Oct 14, 2024
What was the declaration emit in 5.5?
elado commentedon Nov 23, 2024
Also reported in #58914 (my comment)
Seems like this regressed from 5.5 to 5.6 when modules are symlinked (in my case, symlinks in CI/Bazel sandbox).
aminya commentedon Feb 15, 2026
If your package manager uses symlinks to link packages to the cache/store, ensure that you instruct TypeScript to preserve the symlinks.
Add this to tsconfig.json