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

Nova.booting(function (app) {}) receives undefined sometimes #6632

Closed
hivokas opened this issue Dec 23, 2024 · 2 comments
Closed

Nova.booting(function (app) {}) receives undefined sometimes #6632

hivokas opened this issue Dec 23, 2024 · 2 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Milestone

Comments

@hivokas
Copy link

hivokas commented Dec 23, 2024

  • Laravel Version: 11.36.1
  • Nova Version: 5.0.5

Description:

I have a custom script where I register a few components.

Here is what I have in NovaServiceProvider:

Nova::serving(function () {
    Nova::remoteScript(mix('js/nova.js'));
});

Here is what I have in the script:

Nova.booting(function (app) {
  app.component('HtmlContentModal', HtmlContentModal);
});

Sometimes app is undefined (not always) which triggers an error.

Safari Version 18.1.1:

Screenshot 2024-12-23 at 3 35 39 PM

Chrome 131.0.6778.205:

Screenshot 2024-12-23 at 3 37 06 PM

As a result, I just get a gray screen instead of a desired page.

Feels like some kind of race condition.

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Create a script which registers a component.
  2. Register compiled script in service provider.
  3. Open any page in Nova and try to reload it many times. Sometimes you'll be getting this error.
@crynobone crynobone added the bug Verified bug by the Nova team label Dec 23, 2024
@crynobone crynobone added this to the 5.0.x milestone Dec 23, 2024
@crynobone crynobone added pending Issues that are pending triage bug Verified bug by the Nova team fix incoming A fix is in review and removed bug Verified bug by the Nova team pending Issues that are pending triage labels Dec 23, 2024
@hivokas
Copy link
Author

hivokas commented Dec 24, 2024

Thanks for fixing @crynobone! Is the fix going to be part of 5.0.6 release?

@crynobone
Copy link
Member

Yes, it will be part of 5.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants