andreruffert/syntax-highlight-element

Cant change language using setter

Closed this issue · 3 comments

While using this component with Vue I get:

Failed setting prop "language" on <syntax-highlight>: value js is invalid. TypeError: Cannot set property language of #<m2> which has only a getter

As far as I understand component only responds to attribute changes which is incopatible with how Vue interacts with custom elements.

@minht11 I appreciate you sharing this information with me.

I published a new prerelease version 1.2.0-beta.0 which introduces a language setter. After testing the new version, I found that everything worked as expected when using a Vite + Vue preset with the syntax-highlight-element@1.2.0-beta.0.

Please let me know if the new prerelease fixes your described error.
You can install the prerelease via npm install syntax-highlight-element@next.

Thanks!

✌️

Using beta works with vue.