2

I am facing issue while consuming Vue web component in a shell application and this shell application is also developed in Vue.

My Vue web component has its own Vue router and inside router.js of this web component I wrote Vue.use(VueRouter). Similarly my shell application has its own Vue router where I also used same Vue.use(VueRouter) inside their router.js.

I added my web components js (webcomponet-project/dist/sample-web-component.js) in shell application's index.html file like below:

<script src = "../webcomponet-project/dist/sample-web-component.js"></script>

Now when i am starting shell application I am getting the following error?

Uncaught TypeError: Cannot redefine property: $router

What can I do to get rid of this error?

Harshal Patil
  • 17,838
  • 14
  • 60
  • 126
Atul
  • 521
  • 1
  • 7
  • 20

0 Answers0