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.

Not working in Vue3 at all

See original GitHub issue

Im using version 2.1.0

if i import using createapp, then it breaks the entire compilation of vue saying it cannot call method mount of undefined. if i import it as a component from within a component I get the following errors:

Just for using import StarRating from ‘vue-star-rating’ you get the following error in console Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getElementsByTagName') then we actually using the component you get the following error. Uncaught (in promise) TypeError: Cannot read properties of null (reading 'isCE')

is there something i’m missing? I have used this loads of times in vue2 with no issues.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

craigh411commented, Feb 16, 2022

I’m going to check this out in one of my Vue 3 projects to see if I can replicate it. To me, this error looks like it comes from the transpilation of the component, but it was transpiled with the Vue CLI using this command:

npx vue-cli-service build --target lib --name VueStarRating ./src/index.js --mode production

For now, one option would be to transpile it yourself by importing ./src/star-rating.vue into your components directly, then including the package in your build config for .vue files, as the node_modules folder is likely going to be excluded. (see: for how to do this using webpack)

craigh411commented, Jan 10, 2022

Me too, In additional. When I am working with typescript (have not tried JavaScript yet), import StarRating from ‘vue-star-rating’ I got an error from vue-start-rating that said “Could not find a declaration file for module ‘vue-star-rating’.” and the package so heavy if I just need to rate. image

The CommonJS file isn’t minified because it’s assumed minifcation will be done as part of your own build process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue 3 component stops working when included in a parent ...
Due to the nature of our project, we want use in-DOM templates. This works fine for a single component. But once a child...
Read more >
Javascript doesn't work in Vue3 · Issue #3 · themesberg/flowbite
Hey there, I am using a fresh project with tailwind2, flowbite 1.1.1 and vue3. The backend stack ist laravel 8 (php8) with inertia.js....
Read more >
Vue 3 Component not showing - blade is showing - Laracasts
Hello, My vue component is now displaying on the webpage but the content on blade is showing. I have used laravel 8, vue3,...
Read more >
Reactivity in Depth - Vue.js
Vue's reactivity system is primarily runtime-based: the tracking and triggering are all performed while the code is running directly in the browser. The...
Read more >
Using Vue with TypeScript - Vue.js
All official Vue packages come with bundled type declarations that should work ... This is a bit inefficient and can lead to performance...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found