Can't load panel of multi-site setup after upgrading to 3.2

Hi,

I am developing have a multi-site setup with Kirby 3, for three sites that share the same codebase but have different content. I’ll call them “site1”, “site2” and “site3”.

After updating from Kirby 3.1.3 to Kirby 3.2.3, the panel has stopped working.

I have cleared the cache (Kirby’s and my browser’s), deleted all files under the sessions folder and the media folder, but the error persists.
I think there is something wrong with the way I have configured the paths on my index.php file, but I cannot figure out what is wrong.

The panel is showing a blank screen, and my browser’s console shows this messages:

The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/plugins.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/app.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/app.js”. panel:442:1
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/plugins.js”. panel:439:1
The script from “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/vendor.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
Loading failed for the <script> with source “http://site1.localhost/media/panel/070afde0274dc6039a8a8949d12a15cd/js/vendor.js”. panel:440:1
TypeError: panel.plugin is not a function (index.js:1:84638)

This is what my index.php file looks like, this was working fine with 3.1.3:

<?php
require __DIR__ . '/kirby/bootstrap.php';

$sites = [
  'site1.localhost' => __DIR__ . '/site1',
  'site1-staging.domain.com' => __DIR__ . '/site1',
  'site1.com' => __DIR__ . '/site1',

  'site2.localhost' => __DIR__ . '/site2',
  'site2-staging.domain.com' => __DIR__ . '/site2',
  'site2.com' => __DIR__ . '/site2',

  'site3.localhost' => __DIR__ . '/site3',
  'site3-staging.domain.com' => __DIR__ . '/site3',
  'site3.com' => __DIR__ . '/site3',
];

$url  = Url::host();

if($url == "localhost") {
  $subdomain = array_shift((explode('.', $_SERVER['HTTP_HOST'])));
  $url = $subdomain . '.' . $url;
}
$root = $sites[$url];

$kirby = new Kirby([
  'roots' => [
    'index'   => __DIR__,
    'content' => $root . '/content',
    'media'   => $root . '/media'
  ]
]);

echo $kirby->render();

I’d be very grateful for any hints on what’s wrong with my setup.

Thank you,
Laura

Do these files even exist in the media folder?

Hi @texnixe, thanks for your reply!

Yes, they do exist – this would be a screenshot of one of the sites:

That’s the wrong folder though, according to the error message, it searches for the file in /070afde0274dc6039a8a8949d12a15cd. Is /* the way your system marks JS files?

Ah sorry, I chose the wrong folder, but yes, the files exist on the folder referenced in the terminal.
That “/*” is an icon that my text editor uses to indicate this is a Javascript file.

Can you view the files if you open their URL directly in a browser?

And one other question: Does the Panel work correctly in a non-multisite setup?

When opening the URL in the browser, what I could see was the front-end of the site using the default.php template (which is the only template I have), but no content was visible.

In order to check if the panel would work in a non-multisite setup, I changed the index.php file to be like the default index.php file included in the starterkit, then tried to load the panel – it worked.
Afterwards, I reverted the changes to use my multi-site index.php, and the panel still works…

I’m happy because it seems to be fixed, however I don’t understand what the issue might have been. I guess some cache, but as far as I can think of, I deleted all caches…

Thank you for your help, @texnixe. :slight_smile:

Maybe some server-side caching or whatever. One of those mysteries…

Indeed, a mystery! Thank you again for your time and help.