"This is likely not portable" error
Randomly started getting this weird error on my front end, can't find anything online on it. Something wrong with my project config, I'm sure
It appears on my trpc react but also in some other places:
Any ideas?
7 Replies
had
composite: true
in the tsconfig.json
, removing that fixed it idk whyI bet @ixahmedxi can tell us
I’ve seen this a lot when the api project has dependencies producing types into the API which aren’t available to the client via node_modules
Composite might end up relating to that behaviour
hmm i remember getting this error as well
but i completely forgot how i solved it
Using monorepo module hoisting or installing the dep in both projects generally fixes it
But there are other magic tsconfig things I’ve seen people do (quite a bit of history in this forum)
hmm I just disabled hoisting to fix some other issue lol
probably what caused it to start happening
You can be more specific in how you disable hoisting, or you can install Prisma into both projects just for the types
Or tsconfig tweaks but that seems fragile and might break other stuff too 😅
I got same issue, but I solved to set 'baseUrl' in tsconfig.json with turborepo / pnpm