Home > Net >  Uncaught TypeError: Alpine.plugin is not a function
Uncaught TypeError: Alpine.plugin is not a function

Time:10-02

In app.js file i put

import Alpine from 'alpinejs';
window.Alpine = Alpine
Alpine.start()
import collapse from '@alpinejs/collapse';
Alpine.plugin(collapse)

its complied successfully without error in laravel mixer, but in the browser console after refreshing page will show the next error

   at Module../resources/js/app.js (app.js?id=0ad42e965c3fd374b790:4118)
   at __webpack_require__ (app.js?id=0ad42e965c3fd374b790:21603)
   at app.js?id=0ad42e965c3fd374b790:21756
   at Function.__webpack_require__.O (app.js?id=0ad42e965c3fd374b790:21640)
   at app.js?id=0ad42e965c3fd374b790:21758
   at app.js?id=0ad42e965c3fd374b790:21760
./resources/js/app.js @ app.js?id=0ad42e965c3fd374b790:4118
__webpack_require__ @ app.js?id=0ad42e965c3fd374b790:21603
(anonymous) @ app.js?id=0ad42e965c3fd374b790:21756
__webpack_require__.O @ app.js?id=0ad42e965c3fd374b790:21640
(anonymous) @ app.js?id=0ad42e965c3fd374b790:21758
(anonymous) @ app.js?id=0ad42e965c3fd374b790:21760```

looking for help to solve this problem

CodePudding user response:

I had this exact issue but fixed by npm update alpinejs

update alpine core to 3.4.2

  • Related