Skip to content
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

(New in 2.7.4) Property 'env' does not exist on type 'ImportMeta'. #6206

Closed
7 tasks done
ZYinMD opened this issue Dec 21, 2021 · 1 comment · Fixed by #6214
Closed
7 tasks done

(New in 2.7.4) Property 'env' does not exist on type 'ImportMeta'. #6206

ZYinMD opened this issue Dec 21, 2021 · 1 comment · Fixed by #6214

Comments

@ZYinMD
Copy link

ZYinMD commented Dec 21, 2021

Describe the bug

In v2.7.4, import.meta.env doesn't pass tsc --noEmit out of the box, due to some typing errors.

v2.7.3 didn't have this issue.

Reproduction

yarn create vite demo --template vanilla-ts
cd demo
yarn
yarn build

↑ works.

Then add in main.ts :

console.log(import.meta.env.DEV);

Then build again:

yarn build

This time it'll fail with error:

error TS2339: Property 'env' does not exist on type 'ImportMeta'.

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
    Memory: 8.47 GB / 22.95 GB
  Binaries:
    Node: 16.5.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - ~\scoop\apps\yarn\current\Yarn\bin\yarn.CMD
    npm: 7.19.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 96.0.4664.110
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.57)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    vite: 2.7.4 => 2.7.4

Used Package Manager

yarn

Logs

No response

Validations

@ydcjeff
Copy link
Contributor

ydcjeff commented Dec 21, 2021

Duplicate of #6194

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants