vuejs / vitepress

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

provide an export named 'defineConfig #4395

Open thunderwin opened 5 days ago

thunderwin commented 5 days ago

Describe the bug

Uncaught SyntaxError: The requested module '/nodemodules/.pnpm/vitepress@1.3.4@algolia+client-search@5.15.0_postcss@8.4.31_search-insights@2.17.3/node_modules/vitepress/dist/client/index.js?v=6d33447f' does not provide an export named 'defineConfig' (at config.mjs:1:10)

Reproduction

突然出现这个问题,export default defineConfig(default_config) 实际上提供了!

Expected behavior

正常

System Info

System:
    OS: macOS 11.7.10
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 100.57 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 20.16.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.1 - /usr/local/bin/npm
    pnpm: 8.4.0 - /usr/local/bin/pnpm
    bun: 1.0.4 - ~/Library/Application Support/reflex/bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.86
    Safari: 15.1
  npmPackages:
    vitepress: ^1.3.4 => 1.3.4

Additional context

No response

Validations

brc-dd commented 5 days ago

Please show the relevant code. It shouldn't happen unless you're importing defineConfig within your markdown/vue component.

thunderwin commented 5 days ago

even I use defult config, still error

import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'Homepage',
  description: 'Homepage',
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: 'Home', link: '/' },
      { text: 'Examples', link: '/markdown-examples' }
    ],

    sidebar: [
      {
        text: 'Examples',
        items: [
          { text: 'Markdown Examples', link: '/markdown-examples' },
          { text: 'Runtime API Examples', link: '/api-examples' }
        ]
      }
    ],

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ]
  }
})
thunderwin commented 5 days ago

just happend .it was works.

brc-dd commented 5 days ago

Are you importing your config somewhere? If possible can you share your git repository or show what you're doing using https://vitepress.new?

thunderwin commented 4 days ago

Are you importing your config somewhere? If possible can you share your git repository or show what you're doing using https://vitepress.new?

like I said .even I change to default config, error still there. wired.