-
Notifications
You must be signed in to change notification settings - Fork 263
Description
在一个vitepress项目中引用了Select组件,在运行时报错:
vitepress v1.6.3
- building client + server bundles...
✓ building client + server bundles...
/home/runner/work/icons/icons/node_modules/.pnpm/lu2@2024.9.2/node_modules/lu2/theme/edge/js/common/ui/Follow.js:20
HTMLElement.prototype.follow = function (eleTarget, options) {
^
ReferenceError: HTMLElement is not defined
at Object. (/home/runner/work/icons/icons/node_modules/.pnpm/[email protected]/node_modules/lu2/theme/edge/js/common/ui/Follow.js:20:1)
at Module._compile (node:internal/modules/cjs/loader:1529:14)
at Module.extensions..js (node:internal/modules/cjs/loader:1613:10)
at Module.load (node:internal/modules/cjs/loader:1275:32)
at Module.load (node:internal/modules/cjs/loader:1096:12)
at cjsLoader (node:internal/modules/esm/translators:298:15)
at ModuleWrap. (node:internal/modules/esm/translators:240:7)
at ModuleJob.run (node:internal/modules/esm/module_job:263:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:540:24)
at async build (file:///home/runner/work/icons/icons/node_modules/.pnpm/[email protected]_patch_hash=tlnxzbihbonwbuvnbcvsp2zqhq@algolia[email protected]@types+no_nlwdeth6vfi2jtkor5c5he2wyu/node_modules/vitepress/dist/node/chunk-Zsoi3j4v.js:49587:24)
建议在javascript源码部分,能增加 isBrowser 的判断,避免在node环境下报错!