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

类型“ImportMeta”上不存在属性“env”. #6211

Closed
7 tasks done
yanbowe opened this issue Dec 21, 2021 · 2 comments · Fixed by #6214
Closed
7 tasks done

类型“ImportMeta”上不存在属性“env”. #6211

yanbowe opened this issue Dec 21, 2021 · 2 comments · Fixed by #6214

Comments

@yanbowe
Copy link

yanbowe commented Dec 21, 2021

Describe the bug

从2.7.3升级至2.7.4后报错类型“ImportMeta”上不存在属性“env”。

当我执行pnpm up升级项目依赖,vite从2.7.3升级至2.7.4后,重启vscode再次打开项目会报错类型“ImportMeta”上不存在属性“env”。

Reproduction

https://github.com/ArcherGu/vite-static-site

打开项目执行pnpm install 在app.vue里打印console.log(import.meta.env),然后执行pnpm up,升级完成后,重启vscode 重新打开项目,会看到app.vue中提示类型“ImportMeta”上不存在属性“env”。

System Info

System:
    OS: Windows Server 2016 10.0.14393
    CPU: (4) x64 Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
    Memory: 5.71 GB / 15.94 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.14393.2007
  npmPackages:
    @vitejs/plugin-vue: ^2.0.1 => 2.0.1
    vite: ^2.7.4 => 2.7.4

Used Package Manager

pnpm

Logs

No response

Validations

@yanbowe
Copy link
Author

yanbowe commented Dec 21, 2021

image
2.7.4下
image
2.7.3下
image

像这样,2.7.4比2.7.3少了几个类型

@bluwy
Copy link
Member

bluwy commented Dec 21, 2021

Duplicate of #6194

@bluwy bluwy marked this as a duplicate of #6194 Dec 21, 2021
@bluwy bluwy closed this as completed Dec 21, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2022
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.

2 participants