question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue Custom Element in Typescript Error

See original GitHub issue

When attempting to call Vue.use(VueCustomElement), the compiler throws an error:

__WEBPACK_IMPORTED_MODULE_0_vue__.default.customElement is not a function

Opening up the index.d.ts file and adding: static default:any to the class, then calling: Vue.use(VueCustomElement.default) appears to fix this error, though I’m not sure if this is the correct way of going about doing this.

@isaaclyman Is it possible to see an example of the correct implementation of custom elements in Typescript?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
isaaclymancommented, Jan 30, 2018

@thedaruma The latest release should resolve this issue, if you’re still seeing it. Sorry about the delay.

0reactions
ryangiordanocommented, Jan 31, 2018

Thank you for your work on this. I am able to move forward. Really appreciate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How use vue-custom-element with Vue+Typescript
I'm using vue-custom-element to create my custom element, but I created a vue project with typescript and when trying to assign the store...
Read more >
Got “Unknown custom element” while rendering using vue ...
@Kokodoko What I want to do is to import all components in one single file (components/index.ts) and export them again so I can...
Read more >
Angular elements overview
Angular elements are Angular components packaged as custom elements (also called Web Components), a web standard for defining new HTML elements in a ......
Read more >
How to use Vue 3 with TypeScript - LogRocket Blog
In this article, we've covered all the basic information you need to create a Vue application completely in TypeScript with custom decorator ...
Read more >
@vitejs/plugin-vue - npm
Using Vue SFCs as Custom Elements · { customElement: true } will import all *.vue files in custom element mode. · Use a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found