添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
长情的紫菜汤  ·  Ukraine | University ...·  2 周前    · 
曾经爱过的汉堡包  ·  MySQL ...·  2 月前    · 

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

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

No response

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guidelines .
  • Read the docs .
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server .
  • The provided reproduction is a minimal reproducible example of the bug.
  •