vue: Cannot add property _Ctor, object is not extensible

Version

2.6.11

Reproduction link

https://github.com/mjmnagy/error-sept-10-2020

Steps to reproduce

  1. npm run rollup:inline
  2. Include the package into a nuxt project (I have been doing it internally by replacing the dist folder in node_modules)
  3. npm run dev
  4. Error Cannot add property _Ctor, object is not extensible

What is expected?

  1. Attempting to create a component library that has SSR support

What is actually happening?

Cannot add property _Ctor, object is not extensible


The package has additional components and i have gone through one by one and tried to eliminate other factors. It seems that when l refresh the page, the error is present but when navigating the components it works.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

@mjmnagy could you fix the error?

Yes

changed:

components:{
  MyComp:() => import('...')
}

to

import MyComp from '....';

components:{
 MyComp
}

A: () => import('@/components/A.vue').then(d => d.default) Great, it’s really work for me

Hi,

Due to a circle dependancy that I need to break with inline import, I had been the same issue.

A:() => async () => (await import('@/components/A.vue')).default, doesn’t work for me.

but I’ve resolve it with:

A: () => import('@/components/A.vue').then(d => d.default)

HTH

A: () => import('@/components/A.vue').then(d => d.default) Great, it’s really work for me Thank, you are great