Skip to content
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

[11.x] Re: Fix issue with missing 'js/' directory in broadcasting installation command #50657

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

alnahian2003
Copy link
Contributor

Issue

After installing a fresh Laravel app with the Breeze 'api' stack, the install:broadcasting command to enable broadcasting throws an error:

> php artisan install:broadcast 

  INFO Published 'broadcasting' configuration file.  

  INFO Published 'channels' route file.  


  ErrorException 

 copy(laravel-app\resources\js/echo.js): Failed to open stream: No such file or directory

 at vendor\laravel\framework\src\Illuminate\Foundation\Console\BroadcastingInstallCommand.php:56
   52▕     $this->enableBroadcastServiceProvider();
   53▕
   54▕     // Install bootstrapping...
   55▕     if (! file_exists($echoScriptPath = $this->laravel->resourcePath('js/echo.js'))) {
 ➜ 56▕       copy(__DIR__.'/stubs/echo-js.stub', $echoScriptPath);
   57▕     }
   58▕
   59▕     if (file_exists($bootstrapScriptPath = $this->laravel->resourcePath('js/bootstrap.js'))) {
   60▕       $bootstrapScript = file_get_contents(

 1  vendor\laravel\framework\src\Illuminate\Foundation\Console\BroadcastingInstallCommand.php:56

 2  vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
   Illuminate\Foundation\Console\BroadcastingInstallCommand::handle()

Solution

The error is occurring because the 'js/' directory in the resource path doesn't exist yet. This can be fixed by creating the directory before copying echo.js inside it. This PR addresses the issue.

@akr4m
Copy link
Contributor

akr4m commented Mar 19, 2024

I already noticed that issue.
Thanks for resolving that.

@taylorotwell taylorotwell merged commit 578c882 into laravel:11.x Mar 19, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants