vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.17k stars 2.12k forks source link

The Aside component is render nothing #2157

Closed haiting closed 1 year ago

haiting commented 1 year ago

Describe the bug

when I update the version to "vitepress": "^1.0.0-alpha.63", , and run vitepress dev docs, The Aside component is render nothing

Reproduction

update the vitepress version to "vitepress": "^1.0.0-alpha.63",

run vitepress dev docs

config.js

import { defineConfigWithTheme } from 'vitepress';
import vueJsx from '@vitejs/plugin-vue-jsx';
import baseConfig from '@vue/theme/config';
import { demoBlockPlugin } from 'vitepress-theme-demoblock';
import path from 'path';

import { i18n, nav, sidebar } from './themeConfig/index';

export default defineConfigWithTheme({
  extends: baseConfig,
  lang: 'zh-CN',
  title: 'SinoGear Vue',
  description: '',
  srcDir: './src',
  scrollOffset: 'header',
  ignoreDeadLinks: true,
  head: [['meta', { name: 'theme-color', content: '#3c8772' }]],
  themeConfig: {
    nav,
    sidebar,
    appearance: false, // 开启 light/dark 模式
    // Placeholder of the i18n config for @vuejs-translations.
    i18n,
  },

  markdown: {
    config(md) {
      md.use(demoBlockPlugin, {
        cssPreprocessor: 'less',
        scriptImports: [
          "import * as AntDesignVue from 'ant-design-vue'",
        ],
        scriptReplaces: [
          {
            searchValue: /import ({.*}) from 'ant-design-vue'/g,
            replaceValue: (s, s1) => `const ${s1} = AntDesignVue`
          },
        ]
      });
    }
  },

  vite: {
    server: {
      host: true,
      port: 3001,
      fs: {
        // for when developing with locally linked theme
        allow: ['../..']
      }
    },
    build: {
      chunkSizeWarningLimit: Infinity
    },
    json: {
      stringify: true
    },
    ssr: {
      noExternal: ['@wangeditor/editor', '@wangeditor/editor-for-vue', 'ant-design-vue', '@ant-design/icons-vue', '@babel/runtime']
    },
    plugins: [vueJsx()],
    css: {
      preprocessorOptions: {
        less: {
          javascriptEnabled: true
        }
      }
    }
  },

  vue: {
    reactivityTransform: path.resolve(__dirname, 'src')
  }
});

Expected behavior

render aside component

System Info

packages.json


"@babel/plugin-syntax-jsx": "^7.18.6",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vitejs/plugin-vue-jsx": "^3.0.0",
    "@vue/babel-plugin-jsx": "^1.1.1",
    "@vue/compiler-sfc": "^3.0.4",
    "conventional-changelog-cli": "^2.1.0",
    "cross-env": "^7.0.2",
    "del": "^6.0.0",
    "gulp": "^4.0.2",
    "gulp-babel": "^8.0.0",
    "highlight.js": "^10.4.1",
    "less": "^4.1.2",
    "lint-staged": "^13.0.3",
    "prettier": "^2.7.1",
    "rimraf": "^3.0.0",
    "transliteration": "^2.2.0",
    "vitepress": "^1.0.0-alpha.63",
    "vitepress-plugin-search": "^1.0.4-alpha.17",
    "vitepress-theme-demoblock": "^2.0.0"


### Additional context

_No response_

### Validations

- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
brc-dd commented 1 year ago

Please share reproducible example. It's working fine for us at vitepress.dev.

haiting commented 1 year ago

Please share reproducible example. It's working fine for us at vitepress.dev.

this is a simple demo https://stackblitz.com/edit/vitejs-vite-ls5fsx?file=docs/.vitepress/config.js

brc-dd commented 1 year ago

You're using @vue/theme that we don't track here, nor it's meant for end user usage. If it's an issue with the default theme then feel free to reopen this.

haiting commented 1 year ago

OK! Thx! Thank for finding out the problem