This week our customers reported an issue where CSS and JavaScript were not loading correctly for the CoreUI theme. We investigated the bug and here’s what we did wrong on our end and how to fix it.

Issue

People have reported that their dashboard page looks like this:

instead of a proper version:

Additionally, the login page CSS was missing and JavaScript was not working.


Investigation and reason for the problem

In our generated code, we used the CDN version of the CoreUI theme and loaded resources like this:

CSS:


<link href=" rel="stylesheet" />

JS:


<script src="

Everything worked fine until yesterday when the CoreUI theme released the new version 3 as the main source for this CDN unpkg.com. We used the officially supported version, which is currently 2.1. And version 3.0 is radically different – so when it loads the CSS styles, the classes are different so the theme as a whole doesn’t look good.

Thus, the correct way to charge would ask for the exact version, like this:


<link href=" rel="stylesheet" />
<script src="

Lesson for ourselves: When using CSS and JS from CDN, always specify the exact version you are using.


How to modify/regenerate the code

Here are our recommendations and instructions.

For new panels in QuickAdminPanel

For our new generated panels, we added the fix to the QuickAdminPanel core, immediately as we saw it. So nothing to do for you.


For existing old panels in QuickAdminPanel

For older generated panels, you need to regenerate the theme core:
– Log in to the panel
– Click Settings
– Change the theme from CoreUI to another (AdminLTE 2 or AdminLTE 3)
– Click Update (it will take time)
– Change theme return to CoreUI and click Update again
– Now the code should be regenerated correctly, you can preview and download it


For downloaded/installed projects

If you downloaded the code that is already on your server, you need to modify it two files manually. Replace the CDN links mentioned above, in these files:

resources/views/admin/layouts/admin.blade.php (CSS and JS):

resources/views/admin/layouts/app.blade.php (CSS only):

Replace the highlighted lines of code with these:


<link href=" rel="stylesheet" />
<script src="

And that’s it. An important lesson for us on how to use CDN and what can happen if you do it wrong. We will also modify all of our Github demo repositories with this patch.

On behalf of our team, I personally apologize for the issue and will be happy to assist all customers with the fix via our live chat or email at povilas@laraveldaily.com



Technology

Another Tech Information

Similar Posts