1

I am currently developing a customer AdminHtml page with a form, and after fixing some other errors (which showed error messages) it shows only the spinner when loading the page.

How can this be debugged further? How can I see a proper error message?

Browser Console and Logs are showing nothing of value.

I already found

UIComponent Form - Spinner showing

Magento 2: Spinner kept running and not showing data after creating custom admin grid

but I want to know how to debug this instead of posting my code on StackExchange and let somebody else debug this.

Is there any way to get a proper error message?

6
  • 1
    There is one ajax call fires in all types of UI component grids. It's url contains path like "mui/index/render/". You can check this call in console under network. You should be getting some error in the response of this ajax/api call. Please check. Apr 16, 2020 at 16:56
  • @PratikNavapara Good point, but no, there is no such AJAX call related to my form.
    – Alex
    Apr 17, 2020 at 7:50
  • I found there seems to be some logging, but it's hidden. Trying to activate it with require(['lib/logger/console-logger', 'lib/logger/levels-pool'], function(logger, levels) { logger.setDisplayLevel(levels.ALL)} ); but no luck so far
    – Alex
    Apr 17, 2020 at 9:48
  • 1
    If you are not getting exact error then you can try alternative ways like commenting some ui xml file (grid/form) code step by step and try to find the piece of the code which is responsible for the issue you are getting. This might help you further. Apr 17, 2020 at 10:11
  • @PratikNavapara I got the error reporting working, see answer :)
    – Alex
    Apr 17, 2020 at 10:44

1 Answer 1

3

One approach is to dig into component initialization (via https://twitter.com/vova_yatsyuk/status/1250807165914357762)

There actually is logging with console-logger in place, but it is disabled by default.

If you open your JavaScript console and type:

require(['Magento_Ui/js/lib/logger/console-logger', 
   'Magento_Ui/js/lib/logger/levels-pool'], 
           function(logger, levels) { 
                logger.setDisplayLevel(2) // 2 = WARN 5 = ALL, see levels-pool.js
           }
);

the logging is enabled (stored in local storage). You can reload your page and will get log output from the component loading.

There should be warnings about components which were requested but not loaded.

Also be aware, that the spinner seems to be replaced with the columns entry when doing listings, so another reason the spinner stays, can be a missing entry like that

    <item name="spinner" xsi:type="string">my_listing_columns</item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.