Closed Zal-com closed 1 year ago
Hello there! Thanks for opening your first issue on this repo!
Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.
Backpack communication channels:
backpack-for-laravel
tag;Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.
Thank you!
-- Justin Case The Backpack Robot
Hello @Zal-com i will check this, but can you let me know if in production you are using SSL, and if this URL is correctly config with https, did you try to fully clear cache with
php artisan optimize:clear
I will be attentive to your answer.
Cheers.
hi @Zal-com!
When using APP_ENV=local
Basset works in a dev mode, so assets are being loaded through the CDN.
There's another thing that will help us to debug this, can you please; 1) Open the browser devtools (F12 on windows) 2) Go to Console tab 3) There will be errors there, can you check the domain where it is pointing? That domain will most probably be different from the one you're using.
Please let us know 🙌
Hello @jorgetwgroup and @promatik Thanks for your replies!
My production server has SSL activated and a valid certificate, if that's what you're referring to (it is my very first deploy I'm not very used to those).
I've ran php artisan optimize:clear
and nothing changes.
When on production, all of the errors are 500 and point to https://macusi.be/storage/basset/[some directory]
Here's a screenshot of some errors:
Can you give us yor server error log, because we need to get more details about 500 error. Thanks
They're all basically the same "No hint path defined for [backpack]" :
[27-Aug-2023 10:07:41 Europe/Brussels] PHP Fatal error: Uncaught InvalidArgumentException: No hint path defined for [backpack]. in /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:112
Stack trace:
#0 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php(90): Illuminate\View\FileViewFinder->parseNamespaceSegments()
#1 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php(76): Illuminate\View\FileViewFinder->findNamespacedView()
#2 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/Factory.php(138): Illuminate\View\FileViewFinder->find()
#3 /home/c1926474c/public_html/storage/framework/views/4f5ec361b051cb329165d910ef525585.php(56): Illuminate\View\Factory->make()
#4 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(124): require('/home/c1926474c...')
#5 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(125): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
#6 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire()
#7 /home/c1926474c/public_html/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#8 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(72): Livewire\LivewireViewCompilerEngine->evaluatePath()
#9 /home/c1926474c/public_html/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Illuminate\View\Engines\CompilerEngine->get()
#10 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(195): Livewire\LivewireViewCompilerEngine->get()
#11 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\View\View->getContents()
#12 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\View\View->renderContents()
#13 /home/c1926474c/public_html/storage/framework/views/a43b99fd4fdbbdc4222337ad43eb5fa8.php(17): Illuminate\View\View->render()
#14 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(124): require('/home/c1926474c...')
#15 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(125): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
#16 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire()
#17 /home/c1926474c/public_html/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#18 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(72): Livewire\LivewireViewCompilerEngine->evaluatePath()
#19 /home/c1926474c/public_html/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Illuminate\View\Engines\CompilerEngine->get()
#20 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(195): Livewire\LivewireViewCompilerEngine->get()
#21 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\View\View->getContents()
#22 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\View\View->renderContents()
#23 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\View\View->render()
#24 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\Http\Response->setContent()
#25 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\Http\Response->__construct()
#26 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\Routing\ResponseFactory->make()
#27 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(661): Illuminate\Routing\ResponseFactory->view()
#28 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(586): Illuminate\Foundation\Exceptions\Handler->renderHttpException()
#29 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(492): Illuminate\Foundation\Exceptions\Handler->prepareResponse()
#30 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(409): Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse()
#31 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(217): Illuminate\Foundation\Exceptions\Handler->render()
#32 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(194): Illuminate\Foundation\Bootstrap\HandleExceptions->renderHttpResponse()
#33 /home/c1926474c/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()
#34 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#35 {main}
It is say "No hint path defined for [backpack]", so could be a cache problem, could you try
php artisan config:cache
or update basset to the last version.
Cheers.
Still no change, Basset was already updated to the latest version.
Is it possible that some file is missing for it to work properly? Or some config needed that I forgot to tweak ?
Hey @Zal-com can you go to /storage/framework/views/4f5ec361b051cb329165d910ef525585.php
and post here the content ?
If not available anymore (you cleared the cache), please trigger the same error and get the new view cache hash from line #3
.
Thanks
Hello @pxpm, here is the content of the file :
<?php
$title = 'Error '.$error_number;
?>
<?php $__env->startSection('after_styles'); ?>
<style>
.error_number {
font-size: 156px;
font-weight: 600;
line-height: 100px;
}
.error_number small {
font-size: 56px;
font-weight: 700;
}
.error_number hr {
margin-top: 60px;
margin-bottom: 0;
width: 50px;
}
.error_title {
margin-top: 40px;
font-size: 36px;
font-weight: 400;
}
.error_description {
font-size: 24px;
font-weight: 400;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-12 text-center">
<div class="error_number">
<small>ERROR</small><br>
<?php echo e($error_number); ?>
<hr>
</div>
<div class="error_title text-muted">
<?php echo $__env->yieldContent('title'); ?>
</div>
<div class="error_description text-muted">
<small>
<?php echo $__env->yieldContent('description'); ?>
</small>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_user() && (Str::startsWith(\Request::path(), config('backpack.base.route_prefix'))) ? 'backpack::layouts.top_left' : 'backpack::layouts.plain', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/c1926474c/public_html/resources/views/errors/layout.blade.php ENDPATH**/ ?>
Hello @Zal-com I think the error is raised by the errror views.
Can you delete the content of resources/views/vendor/backpack/ui/errors
folder ? If you don't have that folder, you probably have resources/views/errors
(back it up, and delete them too)-
It should pick the updated error views from the package and it would work.
Also make sure you are running the latest version of Backpack.
Let me know.
Cheers
Hi @pxpm, I deleted the files you told me to but still no change.
I don't quit get it though. How could the errors files be the problem?
I've tried to access a wrong URL and got the new errors messages coming with the latest version of backpack. So it is indeed loading from the package.
I'm starting to wonder if a fresh install of the package is a viable option ?
Hey @Zal-com, the reason why I think the errors are the problem is because from the blade file you posted, I can see that your error views are calling config('backpack.base.route_prefix'))) ? 'backpack::layouts.top_left' : 'backpack::layouts.plain'
. And that is the line that trigger the error can't find backpack namespace bla bla bla
.
As you can see from a code search on our main repo + our themes repos we are not using that key backpack::layout
anywhere.
https://github.com/search?q=repo%3ALaravel-Backpack%2FCRUD+backpack%3A%3Alayouts&type=code https://github.com/search?q=repo%3ALaravel-Backpack%2Ftheme-tabler+backpack%3A%3Alayouts&type=code https://github.com/search?q=repo%3ALaravel-Backpack%2Ftheme-coreuiv2+backpack%3A%3Alayouts&type=code https://github.com/search?q=repo%3ALaravel-Backpack%2Ftheme-coreuiv4+backpack%3A%3Alayouts&type=code
That makes me think you are using an outdated version of the file.
Also after deleting the files please do a php artisan view:clear && php artisan basset:clear && php artisan basset:cache
Can you post the return of php artisan backpack:version
?
Cheers
Ok I get it. Could it be something I did wrong while upgrading from v5 top v6 ?
Here's the output :
### PHP VERSION:
PHP 8.2.5 (cli) (built: Apr 12 2023 16:01:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
### LARAVEL VERSION:
10.26.1.0
### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.1
backpack/crud: 6.2.3
backpack/generators: v4.0.2
backpack/permissionmanager: 7.0.1
backpack/theme-coreuiv2: 1.2.1
backpack/theme-coreuiv4: 1.1.1
backpack/theme-tabler: 1.1.1
Hello there,
I've tried to make a fresh install of backpack by removing the package and all related files in my project and reinstalling it.
Even with a fresh start, the issue seems to be the very same with basset not being able to check.
Cheers
Hello @Zal-com what kind of server are you using? is a VPS, with php installed, docker or any other virtual server? im asking because i get a few errors with basset using docker because not correctly set networking on docker.
Cheers.
Hi @jorgetwgroup I'm using a VPS. Good to know it has issues with containers, I was planning on testing those out for my issue. Thanks
I have the same issue when using https. When we disable https and access the server over http, the assets are available
Hi @Rian190
can you try to add on your app/Providers/AppServiceProvider.php boot method this:
public function boot(): void
{
\URL::forceScheme('https');
}
Cheers
Hello @Zal-com
Please let us know if you still continue with the same problem or if it has already been resolved, if the same problem continues, send us the details and actions you have taken so that we can provide support, in case we do not receive news from you we will close the issue but you are free to open it again.
Thank you.
Hi @Rian190
can you try to add on your app/Providers/AppServiceProvider.php boot method this:
public function boot(): void { \URL::forceScheme('https'); }
Cheers
I figured out my sollution:
app_url
in .env
is https://...
instead of http://...
Closing. Thank you all 🙏 , if anyone still has issues please re-open if you have the same issue, or open a new one.
Cheers
Solved replacing 'local' to 'production' in config/basset/basset/php:
// development mode, assets will not be internalized
'dev_mode' => env('BASSET_DEV_MODE', env('APP_ENV') === 'production'),
Solved replacing 'local' to 'production' in config/basset/basset/php:
// development mode, assets will not be internalized 'dev_mode' => env('BASSET_DEV_MODE', env('APP_ENV') === 'production'),
Hi, i've a similar issue with basset :( I think this path "config/basset/basset/php" is wrong..
Can you please confirm ? /vendor ?
Hey @janeitzke I don't think that solved you problem. You basically just disabled basset in production, so you are using the CDNs and not caching your file versions on the server.
That means your production site can break at anytime if there is an outage in the CDN without you being aware of it, that's why it's important to run the basset:clear && basset:cache
on your deployment script.
@blondie63 never change nothing in vendor, if you don't have the file in your config/backpack/
folder most likely you need to publish the configuration file, there are instructions for it in the read me, but here you go: php artisan vendor:publish --provider="Backpack\Basset\BassetServiceProvider"
Please note that this is not the solution, this configuration is used to disable basset in local mode, so if env
is anything other than production
, basset will be disabled if not specifically enabled by developer with BASSET_DEV_MODE=true
.
Do you have any issue regarding this open that you can direct me ?
Cheers
Hi @pxpm yes i can chat direct with you.. here ? Anyway i explain here my problem: All my applications are now all based on Laravale 11 and Backpack V6.x
All my applications are on Github repositories and we use two main branches: master_dev and master_prod
The deployment takes place automatically on my servers managed by runcloud.io which allows you to have a history of the last 5 publications so you can go back very quickly in case of problems
My collaborators and I develop and do the first tests locally, then we push to master_dev and do further tests, when everything is ok we push to master_prod
Now there is the need to have a "storage" that is outside the "root app" so that user files are preserved
I would like to know what the optimal configuration is regarding: backpack basset
For both local and production environments
PS. I think this could be useful to all Backpack customers and perhaps should be posted in your https://backpackforlaravel.com/docs/
Regards
Mauro
in my case storage is not connected to public
php artisan storage:link
it will solve the issue
Hi,
All of backpack's CSS refuses to load when I put
APP_ENV=production
.The dashboard looks like this :
I've tried all of basset's commands such as
basset:clear
,basset:fresh
&basset:cache
but none seem to solve my issue.Here's the ouptut of
php artisan basset:check
:ERROR Error fetching the file.
│ Backpack Basset failed to check it's working properly. │ │ This may be due to multiple issues. Please ensure: │ 1) APP_URL is correctly set in the .env file. │ 2) Your server is running and accessible at http://macusi.be. │ 3) The public disk is properly configured in config/filesystems.php. │ Optionally, basset provides a disk named "basset", you can use it instead. │ 4) The storage symlink exists and is valid (by default: public/storage). │ │ For more information and solutions, please visit the Backpack Basset FAQ at: │ https://github.com/laravel-backpack/basset#faq
I have checked everything listed and it looks good to me.
Everything works fine when I go back to
APP_ENV=local
.I've tried everything listed on #5302 but nothing seems to work either.
Here's the outout from
php artisan backpack:version
:PHP VERSION:
PHP 8.2.5 (cli) (built: Apr 12 2023 16:01:18) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.5, Copyright (c) Zend Technologies
LARAVEL VERSION:
10.24.0.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.0 backpack/crud: 6.2.2 backpack/generators: v4.0.2 backpack/permissionmanager: 7.0.1 backpack/theme-coreuiv2: 1.2.1 backpack/theme-coreuiv4: 1.1.1 backpack/theme-tabler: 1.1.1