vuepress-plugin-right-anchor icon indicating copy to clipboard operation
vuepress-plugin-right-anchor copied to clipboard

Error [ERR_REQUIRE_ESM]: require() of ES Module ... lib/node/rightAnchorPlugin.js not supported.

Open llnancy opened this issue 1 year ago • 0 comments

llnancy@lilus-MacBook-Pro vuepress-2.x % yarn start
yarn run v1.22.19
$ vuepress dev docs
/Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/vuepress-plugin-right-anchor/lib/node/rightAnchorPlugin.js:4
const utils_1 = require("@vuepress/utils");
                ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/@vuepress/utils/dist/index.js from /Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/vuepress-plugin-right-anchor/lib/node/rightAnchorPlugin.js not supported.
Instead change the require of index.js in /Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/vuepress-plugin-right-anchor/lib/node/rightAnchorPlugin.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/vuepress-plugin-right-anchor/lib/node/rightAnchorPlugin.js:4:17)
    at Object.<anonymous> (/Users/llnancy/workspace/llnancy-projects/vuepress-2.x/node_modules/vuepress-plugin-right-anchor/lib/node/index.js:17:29) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.15.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

vuepress's version is ^2.0.0-beta.61

llnancy avatar Mar 28 '23 10:03 llnancy