You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using VitePress to build pages that contain @giscus/vue component. It works fine on dev server, but when building the following error occurs. The error goes away if the filename index.es.js is changed to index.mjs. (Similar error is reported here: vuejs/vitepress#1399)
(node:9201) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
build error:
/home/xxx/repo/node_modules/.pnpm/@[email protected][email protected]/node_modules/@giscus/vue/dist/index.es.js:1
import { defineComponent as n, ref as l, onMounted as a, openBlock as i, createElementBlock as o, createCommentVNode as u } from "vue";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1055:15)
at Module._compile (node:internal/modules/cjs/loader:1090:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
ELIFECYCLE Command failed with exit code 1.
The text was updated successfully, but these errors were encountered:
I'm using VitePress to build pages that contain
@giscus/vue
component. It works fine on dev server, but when building the following error occurs. The error goes away if the filenameindex.es.js
is changed toindex.mjs
. (Similar error is reported here: vuejs/vitepress#1399)The text was updated successfully, but these errors were encountered: