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
import{index}from"@ts-monorepo/validation/zod";// One level depth is autocompleted ^// This works ONLY if there's one level depth export in package.jsonimport{EmailSchema}from"@ts-monorepo/validation/zod/base.ts";// No autocomplete beyond this ^// If there's no `./zod` export in `exports`, not even `zod` path is autocompleted
π Actual behavior
As you can see in the example, my base tsconfig.json has resolvePackageJsonExports set to true.
My packages have exports field in package.json to export a bunch of things. There are actually two issues.
There's no autocomplete beyond one level depth of exports.
In my production application, there's like 90% chance that any given thing exported from my packages are not suggested for imports. I have to import it at least once for it to appear later. And even that is forgotten after some time.
π Expected behavior
It should autocomplete all given paths defined in exports field.
It should suggest all exported things from a package
Additional information about the issue
The second issue is tricky because it doesn't happen in this small reproduction.
My app have around 100k LOC and almost all exported things in my packages cannot be autoimported because typescript somehow doesn't know about them.
If i import them once, they can be autoimported later on somwhere else. However after some time (or after vscode reload), it's forgotten again.
The text was updated successfully, but these errors were encountered:
Seems like "typescript.preferences.includePackageJsonAutoImports": "on" option in vscode fixed it but I'm not sure what's the performance penalty for this? I already struggle with autocomplete performance.
π Search Terms
π Version & Regression Information
β― Playground Link
https://github.com/jansedlon/ts-monorepo-issue/tree/main
π» Code
π Actual behavior
As you can see in the example, my base
tsconfig.json
hasresolvePackageJsonExports
set totrue
.My packages have
exports
field inpackage.json
to export a bunch of things. There are actually two issues.exports
.π Expected behavior
It should autocomplete all given paths defined in
exports
field.It should suggest all exported things from a package
Additional information about the issue
The second issue is tricky because it doesn't happen in this small reproduction.
My app have around 100k LOC and almost all exported things in my packages cannot be autoimported because typescript somehow doesn't know about them.
If i import them once, they can be autoimported later on somwhere else. However after some time (or after vscode reload), it's forgotten again.
The text was updated successfully, but these errors were encountered: