vuepress / core

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

[Bug report] Build throws error in console #378

Closed rikbrowning closed 2 years ago

rikbrowning commented 2 years ago

Bug report

Description

Using vite as my bundler. When I run dev the site builds no issue and navigation is fine. When I run build and try to view the same page I get the following error:

image

Any idea how I can triage this further or what area to start investigating?

Environment info

  System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 877.89 MB / 7.85 GB
  Binaries:
    Node: 14.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - C:\Program Files\nodejs\yarn.CMD
    npm: 7.20.0 - C:\Program Files\nodejs\npm.CMD
  Utilities:
    Git: 2.21.0. - C:\Program Files\Git\cmd\git.EXE
  Browsers:
    Chrome: 92.0.4515.131
    Edge: Spartan (44.19041.423.0), Chromium (92.0.902.67)
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.23
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.23
    @vuepress/client:  2.0.0-beta.23
    @vuepress/core:  2.0.0-beta.23
    @vuepress/markdown:  2.0.0-beta.23
    @vuepress/plugin-active-header-links: v2.0.0-beta.23 => 2.0.0-beta.23
    @vuepress/plugin-back-to-top:  2.0.0-beta.23
    @vuepress/plugin-container: v2.0.0-beta.23 => 2.0.0-beta.23
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.23
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.23
    @vuepress/plugin-nprogress:  2.0.0-beta.23
    @vuepress/plugin-palette:  2.0.0-beta.23
    @vuepress/plugin-prismjs: v2.0.0-beta.23 => 2.0.0-beta.23
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: v2.0.0-beta.23 => 2.0.0-beta.23
    @vuepress/plugin-search: v2.0.0-beta.23 => 2.0.0-beta.23
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.23
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.23
    @vuepress/theme-default:  2.0.0-beta.23
    @vuepress/utils:  2.0.0-beta.23
    vue: ^3.1.0 => 3.2.2
    vue-loader: Not Found
    vue-router: ^4.0.0 => 4.0.11
    vuepress: Not Found
    vuepress-vite: ^2.0.0-beta.23 => 2.0.0-beta.23
meteorlxy commented 2 years ago

Things work well in official docs. Could you please provide a reproduce repo?

github-actions[bot] commented 2 years ago

Hello @rikbrowning. Please provide a minimal reproduction using a GitHub repository or codesandbox. Issues marked with need reproduction will be closed if they have no activity within 3 days.

yuanbug commented 2 years ago

It seem that this problem appears after Vue3.2 released. I deleted the node_modules on one of my computer and meet a similar issue. But my project works well on my another computer. See vue-next issue 4323. You can temporarily use Vue3.1.5 with Vuepress2.0.0-beta.22 to fix it.

meteorlxy commented 2 years ago

@yuanbug You can try to clear browser cache.

rikbrowning commented 2 years ago

@meteorlxy put together a repro at https://github.com/rikbrowning/vuepress-issue

meteorlxy commented 2 years ago

It seems that you did not provide a 404 layout.

We should throw an error if the necessary layout is missing

meteorlxy commented 2 years ago

The root cause it that there are some version conflicts in your project.

rikbrowning commented 2 years ago

I added a 404 layout.

Still get the same error, which dependencies are causing the issue?

meteorlxy commented 2 years ago

@rikbrowning You are using a different version of @vuepress/plugin-register-components