vue-js-modal icon indicating copy to clipboard operation
vue-js-modal copied to clipboard

Cannot read properties of undefined (reading '$modal')

Open encoderuz opened this issue 2 years ago • 5 comments

Hi there ! I have inexplicable problem.
project: laravel 8 & vue 3 and installed vue-js-modal

yarn add vue-js-modal // installed through this

Problem:

Cannot read properties of undefined (reading '$modal')

import {createApp, inject, ref} from 'vue' 
import routes from './routes'
import store from "./store/store";    
import VModal from 'vue-js-modal'
const app = createApp(App)
.use(routes)
.use(store)
.use(VModal); 
app.config.globalProperties.$modal = VModal; //and I commented this line 
app.mount('#app');

Version:

Vue 3

Example & screenshots:

image

encoderuz avatar May 14 '22 15:05 encoderuz

I'm also having this issue

Z3rio avatar Jun 06 '22 16:06 Z3rio

I have this problem too, with Vue3 and Laravel 9

Screen Shot 2022-08-09 at 10 53 23 AM

parrotsoft avatar Aug 09 '22 15:08 parrotsoft

I have same the problem.

MohammadZarifiyan avatar Aug 31 '22 08:08 MohammadZarifiyan

Anybody fixed this? I have same problem

tans27 avatar Jan 13 '23 01:01 tans27

try to inject VModal in context nuxt(2).js export default function (_, inject) { inject("modal", VModal); } but in context receive this install: ƒ (e,t)

Andrevoks avatar Jan 26 '23 10:01 Andrevoks

Facing same issue too when in production mode , btw in development mode modal works Env : vue-js-modal : 2.0.1 nuxt: 2.15.7

Screenshot_1

dnnzz avatar Aug 12 '23 10:08 dnnzz