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

ssg项目中实例化Vconsole会报错ReferenceError: XMLHttpRequest is not defined #655

Open
zhangtengfei91 opened this issue Dec 3, 2023 · 1 comment

Comments

@zhangtengfei91
Copy link

vConsole Version:3.15.1
截屏2023-12-03 19 36 42
截屏2023-12-03 19 39 02

@jir4yu
Copy link

jir4yu commented Jun 9, 2024

remove import from the top of file, then use useEffect instead

useEffect(() => {
    const setupVConsole = async () => {
      const VConsole = (await import('vconsole')).default
      new VConsole()
    }
    setupVConsole()
  }, [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants