-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vite 2.4.0: importMeta.d.ts
types not exporting ImportMeta
and ImportMetaEnv
#4134
Comments
|
Yes, migrated from 2.3.8 or 2.3.7 and updated vía taze, I'll try tmr, thx. |
Why are not exported on d.ts file? I'm missing something?? Maybe New ts version?? |
I'm testing with vitesse template and have the second approach of the doc using types on tsconfig.json file: https://github.com/antfu/vitesse/blob/master/tsconfig.json#L17 |
It is not a problem since build is working, but my intellij ide not resolving this type, while using prevoius versión, the entry on tsconfig.json file just resolves the type. |
It is a property that is being defined on the I believe this is probably the same problem as #4125, and I think the PR I have opened will solve your issue too. |
Edit: #4134 (comment)
- /// <reference types="vite/client" />
+ import 'vite/client';
+ import 'vite/types/importMeta';
+ declare module 'vite/client' {
interface ImportMetaEnv {
LEGACY: boolean;
}
+ } |
@patak-js This actually fixed the problem! So better workaround is: /// <reference types="vite/client" />
+ /// <reference types="vite/types/importMeta" />
interface ImportMetaEnv {
LEGACY: boolean;
} |
Closed in #4138 |
Describe the bug
Typescript cannot resolve
import.meta.globEager
:Reproduction
not required, just see
importMeta.d.ts
fileSystem Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: