mardi 2 juillet 2019

Loading app.js gives error: a.default is not a constructor

enter image description hereI'm trying to use laravel broadcast (laravel 5.3) with pusher. I get "Uncaught TypeError: a.default is not a constructor" after including the app.js file.

I've installed pusher server, laravel elixir and pusher.js I have uncommented these lines in resources/assets/bootstrap.js

import Echo from "laravel-echo"

window.Pusher = require('pusher-js');

window.Echo = new Echo({
     broadcaster: 'pusher',
     key: 'my-pusher-key',
     cluster: 'eu',
     encrypted: true
 });

Then i installed elixir and laravel echo and pusher-js

npm install
npm install --save laravel-echo pusher-js

And at last i run gulp --production

The app.js is generated but i get the error when including it to blade. The error starts here: window.Echo=new a["default"]({broadcaster:"pusher",key.....



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire