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
require() of ES Module /home/projects/paripjqkq.github/node_modules/d3-interpolate/src/index.js from /home/projects/paripjqkq.github/node_modules/@antv/g-base/lib/animate/timeline.js not supported. Instead change the require of index.js in /home/projects/paripjqkq.github/node_modules/@antv/g-base/lib/animate/timeline.js to a dynamic import() which is available in all CommonJS modules.
require() of ES Module /home/projects/paripjqkq.github/node_modules/lodash-es/lodash.js from /home/projects/paripjqkq.github/node_modules/@antv/path-util/lib/parse-path.js not supported. Instead change the require of lodash.js in /home/projects/paripjqkq.github/node_modules/@antv/path-util/lib/parse-path.js to a dynamic import() which is available in all CommonJS modules.
If you encounter these errors, the issue is almost certainly with the upstream library. They need to fix their library to support being imported by Node.
🐛 Question description [Please make everyone to understand it]
Nuxt 是一个 Vue SSR 框架,我在使用 G2Plot 时,遇到了以下错误:
timeline.js 的相关代码:
根据 Nuxt 的说明(https://nuxt.com/docs/guide/concepts/esm),这种情况可能是由于在 ESM 模块中使用了 CJS 语法。
我查到了相关的几个 issue:#1894, antvis/G6#4646
antvis/G6#4646 (comment) 这个解决方案可以解决
d3-interpolate
库的问题,但是还会有新的问题,也是因为使用了require
:以前的相关修复:antvis/G2#3141
请问是否可以协助确认,是否是 g2 生态的库使用了 cjs 语法导致的问题,以及能否建议一定的解决方案?如果能解决 esm 模块中的 cjs 导入就好了。
💻 Link to minimal reproduction
https://stackblitz.com/edit/github-cibroa?file=app.vue
🏞 Expected result
可以正常引入 G2Plot 并使用。
🚑 Any additional [like screenshots]
The text was updated successfully, but these errors were encountered: