Cannot read property 'ToolItem' of undefined
See original GitHub issueExpected Behavior
可以正常使用vue节点
Current Behavior
单独使用x6的时候没这个报错,引用x6-vue-shape的时候报这个错了
Possible Solution
Steps To Reproduce
- yarn add @antv/x6 @antv/x6-vue-shape
- import { Graph } from “@antv/x6”;
- import “@antv/x6-vue-shape”;
Error Message & Stack Trace
client.ts:13 [vite] connecting...
client.ts:43 [vite] connected.
vue-i18n.esm-bundler.js:46 You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
initFeatureFlags @ vue-i18n.esm-bundler.js:46
(anonymous) @ vue-i18n.esm-bundler.js:2216
index.js:15 antdv installed
TypeError: Cannot read property 'ToolItem' of undefined
at button.ts:10
Promise.catch (async)
extractComponentsGuards @ vue-router.esm-bundler.js:2021
(anonymous) @ vue-router.esm-bundler.js:3082
Promise.then (async)
navigate @ vue-router.esm-bundler.js:3077
pushWithRedirect @ vue-router.esm-bundler.js:2972
push @ vue-router.esm-bundler.js:2911
install @ vue-router.esm-bundler.js:3289
use @ runtime-core.esm-bundler.js:4001
default @ install.ts:23
(anonymous) @ main.ts:11
vue-router.esm-bundler.js:72 [Vue Router warn]: Unexpected error when starting the router: Error: Couldn't resolve component "default" at "/data-exploration/user"
at vue-router.esm-bundler.js:2025
warn @ vue-router.esm-bundler.js:72
(anonymous) @ vue-router.esm-bundler.js:3291
Promise.catch (async)
install @ vue-router.esm-bundler.js:3289
use @ runtime-core.esm-bundler.js:4001
default @ install.ts:23
(anonymous) @ main.ts:11
Additional Context
Your Environment
- x6: 1.24.5
- OS: macOS 11.4
- Browser: edge 90
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'ToolItem' of undefined · Issue #3413 ...
Describe the bug Throw error Uncaught TypeError: Cannot read property 'ToolItem' of undefined. And I've found an error in the bundle of ...
Read more >Collision Detection / Cannot read property 'defaultView' of ...
As I pass my collision items into the check, bottom of code, I am getting an error 'Cannot read property 'defaultView' of undefined'....
Read more >Cannot read property XXX of undefined的解决办法_ ...
出错的原因: 意思就出错的个标签没有定义,原因是html的执行顺序是从上到下,在标签还没有加载的时候该方法就被调用了. 解决办法有两个:.
Read more >Cannot read property 'call' of undefined - Esri Community
My custom widget has a click event handler that works with a draw toolbar and a dojo deferred function to create a snapped...
Read more >Ark Tools Command
Ark Taxidermy Tool Item ID and Spawn Command. I can't see the durability of ... An unexpected error occurred: Cannot read property 'forEach'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
为什么不在 X6 的代码里修复呢?这里的 namespace 不是 ES 的标准,所以导致用 ES modules 的方式 import ToolItem 时报错了。
https://github.com/vitejs/vite/issues/3413#issuecomment-974628817
直接引用构建好的就好了