Laravel-Backpack / basset

Better asset helpers for Laravel apps.
MIT License
151 stars 10 forks source link

Some JS files not loaded in production after SSL / HTTPS enabling #106

Closed Astriel closed 5 months ago

Astriel commented 5 months ago

I'm acutally facing a problem I did not have before. I've installed and deployed a domain on my current project deployed on Laravel Forge. Everything was working fine before. But after I've added the HTTPS / SSL certificate, some JS files can't be loaded.

php artisan backpack:version
    ### PHP VERSION:
PHP 8.2.10 (cli) (built: Sep  2 2023 06:59:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.10, Copyright (c), by Zend Technologies

### LARAVEL VERSION:
10.43.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.2
backpack/crud: 6.6.1
backpack/language-switcher: 1.0.1
backpack/logmanager: v5.0.1
backpack/permissionmanager: 7.1.1
backpack/pro: 2.1.1
backpack/theme-coreuiv2: 1.2.3

I'm facing some 404 errors, while files are present on the server. For example :

@basset('https://unpkg.com/jquery@3.7.1/dist/jquery.min.js')

Then the website tries to load : https://mydomain.com/storage/basset/unpkg.com/jquery@3.7.1/dist/jquery.min.js?da0bb19700ee

But I get a 404 error. I've logged-in into SSH on my server, and I can confirm the file is there : root@myproject:/home/forge/test.rl4u.tech/storage/app/public/basset/unpkg.com/jquery@3.7.1/dist# ls jquery.min.js

I've tried to do a : php artisan basset:clear, then php artisan basset:cache or internalize, but still the same problem. Everything was working fine before.

Any ideas ?

Astriel commented 5 months ago

Problem solved. Wrong storage:link when I changed the project name and URL. To solve the problem : rm public/storage php artisan storage:link