vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.29k stars 925 forks source link

[Bug report] 使用插件`vite-svg-loader`报错 #1261

Closed WangJincheng4869 closed 1 year ago

WangJincheng4869 commented 1 year ago

Description

报错信息如下,感觉是因为我的项目用的是vite4.1.1而 文档内置的vite版本为4.0.4导致的。请问如何能升级文档内置的vite版本,使其与我的项目vite版本相同? image

Reproduction

https://stackblitz.com/edit/vuepress-77g32p?file=package.json,docs%2F.vuepress%2Fconfig.ts

Used Package Manager

pnpm

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 17.42 GB / 31.56 GB
  Binaries:
    Node: 18.14.0 - D:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 9.2.0 - D:\Users\jcwang\AppData\Roaming\npm\npm.CMD
  Utilities:
    Git: 2.39.1.
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22621.1265.0), Chromium (110.0.1587.46)
  npmPackages:
    @vuepress/bundler-vite: 2.0.0-beta.60 => 2.0.0-beta.60 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli: Not Found
    @vuepress/client: 2.0.0-beta.60 => 2.0.0-beta.60 
    @vuepress/core: Not Found
    @vuepress/markdown: Not Found
    @vuepress/plugin-active-header-links: Not Found
    @vuepress/plugin-back-to-top: Not Found
    @vuepress/plugin-container: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon: Not Found
    @vuepress/plugin-git: Not Found
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom: Not Found
    @vuepress/plugin-nprogress: Not Found
    @vuepress/plugin-palette: Not Found
    @vuepress/plugin-prismjs: Not Found
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: 2.0.0-beta.60 => 2.0.0-beta.60
    @vuepress/plugin-search: 2.0.0-beta.60 => 2.0.0-beta.60
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data: Not Found
    @vuepress/plugin-toc: Not Found
    @vuepress/shared: Not Found
    @vuepress/theme-default: Not Found
    @vuepress/utils: Not Found
    vue: ^3.2.47 => 3.2.47
    vue-loader: Not Found
    vue-router: ^4.1.6 => 4.1.6
    vuepress: 2.0.0-beta.60 => 2.0.0-beta.60
    vuepress-vite: Not Found
    vuepress-webpack: Not Found
Mister-Hope commented 1 year ago

Vite may include internal breaking changes cross minor, so we are avoiding that to stick vite with minor.

new version will use 4.1.x once it releases.

Mister-Hope commented 1 year ago

cc @meteorlxy This is why I am requesting to release a new version. Project with vite as deps can suffer if there is vite4.1 in project deps tree.

WangJincheng4869 commented 1 year ago

@Mister-Hope 哎~ 升级到vite 4.2.1 这个错误又出现了,有什么办法能彻底解决项目的 vite 版本与 vuepress 冲突问题吗?还是说只能等待 vuepress 发布新版本我才能升级 vite

Mister-Hope commented 1 year ago

如果你在用pnpm,你可以使用pnpm.override