retejs / minimap-plugin

Home Page:https://retejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'clientWidth'

axvm opened this issue · comments

Hi. Looks like something wrong with this plugin. I made simplest component from example with vue renderer. Everything works just like a charm but when I'm trying to use this plugin, minimap doesn't appear and i've got tons of exceptions (all of them same like below) in chrome console.
Is this plugin doesn't compatible with latest version of rete or maybe I did something wrong?

installed via yarn and added to my script

import MinimapPlugin from 'rete-minimap-plugin';
...
editor.use(MinimapPlugin);

Chrome dev console:

Uncaught TypeError: Cannot read property 'clientWidth' of undefined
    at Vue.updateTransform (minimap-plugin.min.js:6)
    at rete.min.js:6
    at Array.reduce (<anonymous>)

Raised on any action (node creation/move, editor zoom or move)

Pkgs versions

"rete": "^1.0.0-alpha.11",
"rete-minimap-plugin": "^0.1.0",

I'll check this bug

I have a Minimap and Vue without errors

Can you provide a live example on codepen/jsfiddle?

@Ni55aN
I'm using rete inside rails app with webpacker so I can't provide you reproduction case. However I resolved this issue by installing some dev dependencies luke pug, tons of vue pks + alias for runtime templates in webpack config.