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
All the exports that are not function* are not actually exported from the package. Looks like this is actually coming from the mlly package, which is expecting to import JS only.
Not sure if this is a bug or not. I'd like to be able to treat other packages within my monorepo as packages (and auto-import them via presets), and not use the dirs option to import them.
Additional context
No response
Logs
$ pnpm tsc
unimport.d.ts:3:36 - error TS2339: Property 'B' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
3 const B: typeof import('common')['B']
~~~
unimport.d.ts:4:36 - error TS2339: Property 'D' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
4 const D: typeof import('common')['D']
~~~
unimport.d.ts:5:36 - error TS2339: Property 'b' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
5 const b: typeof import('common')['b']
~~~
unimport.d.ts:6:36 - error TS2339: Property 'd' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
6 const d: typeof import('common')['d']
~~~
unimport.d.ts:7:36 - error TS2339: Property 'f' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
7 const f: typeof import('common')['f']
~~~
unimport.d.ts:12:36 - error TS2339: Property 'h' does not exist on type'typeof import("/Users/andrew/code/projects/disco/packages/common/index")'.
12 const h: typeof import('common')['h']
~~~
Found 6 errors in the same file, starting at: unimport.d.ts:3
The text was updated successfully, but these errors were encountered:
andrew8088
changed the title
Export auto-scan bug: function arguments and types incorrect become their own exports
Export auto-scan TypeScript bug: function arguments and types incorrect become their own exports
Mar 24, 2024
andrew8088
changed the title
Export auto-scan TypeScript bug: function arguments and types incorrect become their own exports
Export auto-scan does not scan (untranspiled) TypeScript packages correctly
Mar 25, 2024
andrew8088
added a commit
to andrew8088/unimport
that referenced
this issue
Mar 25, 2024
Environment
Node v21.6.2
typescript@5.4.2
unimport@3.7.1
vite@5.1.6
Reproduction
cd
into repopnpm i
cd packages/app
rm unimport.d.ts
pnpm dev
pnpm build
Property '...' does not exist on type ...
errors fromtsc
.Describe the bug
The package we're auto-importing has these functions:
The generated
unimport.d.ts
file looks like this:All the exports that are not
function*
are not actually exported from the package. Looks like this is actually coming from themlly
package, which is expecting to import JS only.Not sure if this is a bug or not. I'd like to be able to treat other packages within my monorepo as packages (and auto-import them via
presets
), and not use thedirs
option to import them.Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: