Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot assign to read only property 'className' of object '#<SVGSVGElement>' #246

Closed
tw00 opened this issue Apr 15, 2019 · 6 comments · May be fixed by ajesse11x/cms#3
Closed
Labels

Comments

@tw00
Copy link

tw00 commented Apr 15, 2019

When building for production, I get the following error whenever a v-tooltip directive is used on a svg element (e.g. vue-font-awesome):

TypeError: Cannot assign to read only property 'className' of object '#<SVGSVGElement>'
   at p (v-tooltip.esm.js:146)

Recently this line was introduced, which apparently does not resolve to true on SVGSVGElement.

https://github.com/Akryum/v-tooltip/blob/4a02b0fe16007a920e7c7837314885779100aa5a/src/utils.js#L33

From my understanding this is because SVGSVGElement does not have a prototype property.

var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
svg.prototype
>> undefined

(Tested in Chrome 73)

@Akryum Akryum added the bug label Apr 15, 2019
@afv
Copy link

afv commented Apr 16, 2019

Hi,

This is happening for me too with SVGGElement (corresponds to the <g> element):

directive tooltip bind hook
TypeError: Cannot assign to read only property 'className' of object '#<SVGGElement>'

@SirHodlington
Copy link

SirHodlington commented Apr 21, 2019

Hello,

I'm also getting the same error message
Uncaught TypeError: Cannot assign to read only property 'className' of object '#<SVGSVGElement>' at removeClasses (v-tooltip.esm.js?e37d:146) at Tooltip._hide (v-tooltip.esm.js?e37d:638) at eval (v-tooltip.esm.js?e37d:835)

Uncaught TypeError: Cannot assign to read only property 'className' of object '#<SVGSVGElement>' at addClasses (v-tooltip.esm.js?e37d:114) at Tooltip._show (v-tooltip.esm.js?e37d:503) at eval (v-tooltip.esm.js?e37d:803)

@sirjones
Copy link

Hi, also getting same error:
Cannot assign to read only property 'className' of object '#<SVGSVGElement>' at addClasses (v-tooltip.esm.js?54de:114) at createTooltip (v-tooltip.esm.js?54de:1019) at bind (v-tooltip.esm.js?54de:1055) at callHook$1 (vue.esm.js?efeb:6685) at _update (vue.esm.js?efeb:6606) at Array.updateDirectives (vue.esm.js?efeb:6587) at invokeCreateHooks (vue.esm.js?efeb:6074) at initComponent (vue.esm.js?efeb:6007) at createComponent (vue.esm.js?efeb:5990) at createElm (vue.esm.js?efeb:5930)

@karolinakuzniewicz
Copy link

When can we expect the fix for this bug? Or perhaps does anyone know some workaround?

@SirHodlington
Copy link

SirHodlington commented Apr 24, 2019

Not sure if this is any help, but I'm getting this error since I'm using yarn instead of npm to install my packages.

@SirHodlington
Copy link

When can we expect the fix for this bug? Or perhaps does anyone know some workaround?

This workaround worked for me
yarn remove v-tooltip
yarn upgrade v-tooltip@2.0.0-rc.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants