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

[Bug report] ReferenceError: __COMMENT_OPTIONS__ is not defined #99

Closed
undefined-hestudio opened this issue Apr 2, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@undefined-hestudio
Copy link

Description

> [email protected] docs:build C:\Users\msqlx\Documents\workdir\blog
> vuepress build src

@vuepress/plugin-blog:  ⚠ Overriding existing page:
/posts/
✔ Initializing and preparing data - done in 29.17s
⠧ Compiling with vite
(!) Some chunks are larger than 1024 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✔ Compiling with vite - done in 148.13s
✖ Rendering 106 pages - failed in 11.10s
ReferenceError: __COMMENT_OPTIONS__ is not defined
    at file:///C:/Users/msqlx/Documents/workdir/blog/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@vuepress/plugin-comment/lib/client/helpers/comment.js:2:24
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async file:///C:/Users/msqlx/Documents/workdir/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress/bundler-vite/dist/index.js:407:30
    at async file:///C:/Users/msqlx/Documents/workdir/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress/utils/dist/index.js:58:20
    at async build (file:///C:/Users/msqlx/Documents/workdir/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress/bundler-vite/dist/index.js:396:3)
    at async CAC.<anonymous> (file:///C:/Users/msqlx/Documents/workdir/blog/node_modules/.pnpm/@[email protected]/node_modules/@vuepress/cli/dist/index.js:231:3)
 ELIFECYCLE  Command failed with exit code 1.

Reproduction

https://github.com/hestudio-community/blog

Used Package Manager

pnpm

System Info

> [email protected] docs:info C:\Users\msqlx\Documents\workdir\blog
> vuepress info


  System:
    OS: Windows 11 10.0.22631
    CPU: (4) x64 Intel(R) Celeron(R) CPU  J1900  @ 1.99GHz
    Memory: 2.04 GB / 7.89 GB
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.5 - ~\AppData\Roaming\npm\pnpm.CMD
    bun: Not Found
  Utilities:
    Git: 2.44.0.
  Browsers:
    Chrome: Not Found
    Edge: Chromium (123.0.2420.65)
  npmPackages:
    @vuepress/bundler-vite: 2.0.0-rc.9 => 2.0.0-rc.9 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli: Not Found
    @vuepress/client: Not Found
    @vuepress/core: Not Found
    @vuepress/markdown: Not Found
    @vuepress/shared: Not Found
    @vuepress/utils: Not Found
    vue: ^3.4.21 => 3.4.21 
    vue-router: Not Found
    vuepress: 2.0.0-rc.9 => 2.0.0-rc.9
@Mister-Hope
Copy link
Member

This is not a mininal reproduction

@undefined-hestudio
Copy link
Author

我无法在默认主题上还原我的依赖版本,因为会出现冲突。所以我新建了具有vuepress-theme-hope的一个初始化仓库。

我对此做出的改动如下:

  1. 将依赖还原成我自己项目的版本(事实上,这是hope主题能更新到的最新依赖版本)。
  2. 修改theme.ts中关于评论的部分。
  3. 插入了client.ts代码。我认为是这里出现了问题,在我去除这一部分代码的时候,它可以正常build。如果包含了这一部分代码,它可以正常启动dev服务器,但是无法正常build,并输出了我之前提供的报错。在评论依赖的历史版本(2.0.0-rc.12),它可以正常编译。

这是我能提供的最小版本了: https://github.com/undefined-hestudio/mininal-blogsource

@Mister-Hope
Copy link
Member

好的我看一下

@Mister-Hope Mister-Hope added the bug Something isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants