Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide an export named 'defineConfig #4395

Open
4 tasks done
thunderwin opened this issue Nov 29, 2024 · 5 comments
Open
4 tasks done

provide an export named 'defineConfig #4395

thunderwin opened this issue Nov 29, 2024 · 5 comments
Labels
need more info Further information is requested

Comments

@thunderwin
Copy link

thunderwin commented Nov 29, 2024

Describe the bug

Uncaught SyntaxError: The requested module '/node_modules/.pnpm/vitepress@1.3.4_@algolia[email protected][email protected][email protected]/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

@thunderwin thunderwin added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 29, 2024
@brc-dd
Copy link
Member

brc-dd commented Nov 29, 2024

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

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Nov 29, 2024
@thunderwin
Copy link
Author

thunderwin commented Nov 29, 2024

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
Copy link
Author

just happend .it was works.

@brc-dd
Copy link
Member

brc-dd commented Nov 29, 2024

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants