简体   繁体   中英

I am using pusher in Laravel 5.4 but I'm getting following error:

app.js echo script:

Echo:join('chatroom')


.listen('MessagePosted', (e) => {
                this.messages.push({
                    message: e.message.message,
                    user: e.user
                });
            });

getting following error:

app.js:37859 [Vue warn]: Error in created hook: "ReferenceError: join is not defined"

(found in )warn @ app.js:37859handleError @ app.js:37944callHook @ app.js:39983Vue._init @ app.js:41425Vue$3 @ app.js:41520(anonymous function) @ app.js:1127__webpack_require__ @ app.js:20(anonymous function) @ app.js:47150__webpack_require__ @ app.js:20(anonymous function) @ app.js:66(anonymous function) @ app.js:69 app.js:37948 ReferenceError: join is not defined(…)handleError @ app.js:37948callHook @ app.js:39983Vue._init @ app.js:41425Vue$3 @ app.js:41520(anonymous function) @ app.js:1127__webpack_require__ @ app.js:20(anonymous function) @ app.js:47150__webpack_require__ @ app.js:20(anonymous function) @ app.js:66(anonymous function) @ app.js:69 app.js:45006 Download the Vue Devtools extension for a better development experience:

install pusher and laravel-echo

you can install it by using

npm install --save laravel-echo pusher-js

I hope this helps

you will also need to compile the code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM