vuepress / core

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

[Bug report] Uncaught TypeError: Cannot read property 'defineClientAppSetup' of undefined #93

Closed yuantongkang closed 3 years ago

yuantongkang commented 3 years ago

Bug report

Description

Steps to reproduce

accroad to officeal Getting Started to init the project ,and then yarn docs:dev"

Expected behavior

can work success

Screenshots

WX20210401-144821@2x.png

Environment info

# Paste output of `vuepress info` here
system:
    OS: macOS 11.2.3
    CPU: (8) arm64 Apple M1
    Memory: 84.09 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.5.1 - ~/.nvm/versions/node/v15.5.1/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.5.1/bin/yarn
    npm: 7.6.3 - /usr/local/bin/npm
  Utilities:
    Git: 2.30.2
  Browsers:
    Chrome: 89.0.4389.114
    Edge: Not Found
    Firefox: Not Found
    Safari: 14.0.3
  npmPackages:
    @vuepress/bundler-webpack:  2.0.0-beta.1 
    @vuepress/cli:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/client:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/core:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/markdown:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-active-header-links:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-back-to-top:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-container:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-nprogress:  1.8.2 (2.0.0-beta.0, 2.0.0-beta.1)
    @vuepress/plugin-palette:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/shared:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/theme-default:  2.0.0-beta.0 (2.0.0-beta.1)
    @vuepress/theme-vue: Not Found
    @vuepress/utils:  2.0.0-beta.0 (2.0.0-beta.1)
    vue:  3.0.7 
    vue-loader:  16.1.2 
    vue-router:  4.0.5 
    vuepress: ^2.0.0-beta.1 => 2.0.0-beta.1 
meteorlxy commented 3 years ago

Well, not sure if it's an issue with pnpm. Please provide a reproduce repository.

yuantongkang commented 3 years ago

Well, not sure if it's an issue with pnpm. Please provide a reproduce repository.

https://github.com/yuantongkang/vuepress2-issue

meteorlxy commented 3 years ago

If you only need vite, you can only use vuepress-vite, and upgrade it to the latest version:

https://github.com/vuepress/vuepress-next/blob/64de63cfacbc4d1d66430055f336eac970a5214c/packages/vuepress-vite/package.json#L2-L3

AGPDev commented 3 years ago

I have issues with pnpm too, i need install using yarn and start with yarn or pnpm to works.

image

meteorlxy commented 3 years ago

Try adding shamefully-hoist=true in the .npmrc file of your project, and re-install deps with pnpm.

See https://pnpm.io/npmrc#shamefully-hoist