-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breeze, Vue, Inertia SSR, ReferenceError: Echo is not defined #406
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
@HarbourDesign Can you post your whole |
@HarbourDesign I was thinking about this some more this morning, and I'm wondering... Did this error show up during compilation, or did you see this in your browser console? |
@HarbourDesign I found your Laracasts post where you presented this issue. I've left the following comment:
@crynobone I'm confident that this issue can be closed since it's not a bug, and is a simple case of user error. |
Echo Version
1.17.1
Laravel Version
11.31
PHP Version
8.3
NPM Version
10.9.0
Database Driver & Version
Mysql
Description
When the Echo channel is written like this in Vue file:
let channel = 'Echo.channel('AdminChannel');
I get the error that Echo is not defined when using SSR (php artisan inertia:start-ssr).
Well I figured out a work around. I added the channel to a function that is control by a button :
At first I tried a setTimeout, but no length of time work. It seems to require human interface, like an activate voice button. Keep in mind, Echo.private('test'); doesn't return an error. Is this Normal or a bug???
Steps To Reproduce
event.php:
channels.php:
page.vue file:
Works fine with php artisan serve and npm run dev, but not with start-ssr and build.
The text was updated successfully, but these errors were encountered: