antvis/G6










The issue has been closed
require() of ES Module not supported #4646
sunface posted onGitHub
Describe the bug
你好,我在nextjs + react18 + typescript的环境下,使用时报如下错误,无论如何都解决不了,最后只能把对应的 require 屏蔽掉。
Error: require() of ES Module /Users/sunfei/development/MyStarship/starship/ui/node_modules/d3-interpolate/src/index.js from /Users/sunfei/development/MyStarship/starship/ui/node_modules/@antv/g-base/lib/animate/timeline.js not supported. Instead change the require of index.js in /Users/sunfei/development/MyStarship/starship/ui/node_modules/@antv/g-base/lib/animate/timeline.js to a dynamic import() which is available in all CommonJS modules.
Your Example Website or App
null
Steps to Reproduce the Bug or Issue
null
Expected behavior
null
Screenshots or Videos
No response
Platform
- OS: [macOS]
- Browser: [Chrome, safari]
- Version: [e.g. 91.1]
Additional context
No response