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] Fix issue with missing 'js/' directory in broadcasting installation command #50650

Closed
wants to merge 4 commits into from

Conversation

alnahian2003
Copy link
Contributor

@alnahian2003 alnahian2003 commented Mar 19, 2024

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.

@driesvints
Copy link
Member

Not sure what you did to make the tests fail but can't seem to get them passing anymore on this PR. Try recreating the PR anew with passing tests.

@driesvints driesvints closed this Mar 19, 2024
@driesvints
Copy link
Member

Sorry, seems this is more widespread. I don't have any clue why this is happening for pull requests but not for our base 11.x branch.

@alnahian2003
Copy link
Contributor Author

Uh oh! I deleted my old fork and created a new one for a new PR. Should I wait though?

@driesvints
Copy link
Member

Reverted something. Can you try again?

@alnahian2003
Copy link
Contributor Author

Sure! Let me give it a try

@alnahian2003
Copy link
Contributor Author

Hey, resubmitted this PR #50657

Hope the checks pass this time 🤞

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.

2 participants