Uncaught (in promise) TypeError: Class constructor EventEmitter cannot be invoked without 'new'
Closed this issue · 4 comments
Hi,
I am using Vue 3 Composition api
and , I've done setup as document
But i have this error when I want to open it
jenesius-vue-modal.cjs.js:495 Uncaught (in promise) TypeError: Class constructor EventEmitter cannot be invoked without 'new'
app.vue
<script setup lang="ts">
import { RouterView } from 'vue-router'
import {container} from "jenesius-vue-modal";
</script>
<template>
<container />
<RouterView />
</template>
homeComponent.vue
import { openModal } from "jenesius-vue-modal";
import MyCom from '@/components/Common/MyCom.vue'
function open() {
openModal(MyCom, { message: "Welcome" })
}
MyCom.vue
<script setup lang="ts">
</script>
<template>
<div class="header1">
Hello
</div>
</template>
How can I fix this ?
I have this problem too.
What do you advise ?
Thank you for opening the issue, I really appreciate it!
The problem was using the ES6 standard in the EventEmitter class.
I resolve this problem with 1.7.0 version:
npm i jenesius-vue-modal@1.7.0
for check solution.
- removing EventEmitter (override modal.on method)
- add test for checking unsubscribe function
@Barakuda91 , @morteza-mortezai I test the last version of library - its working. If someone can update and test it - i will be happy.
Ща тестану
Пока что временно откатился на более стабильную 1.5.0
Version 1.7.0 works great! Thank!