Laravel-Backpack / basset

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

Format URL issue with files from package #128

Closed dauvray closed 2 months ago

dauvray commented 2 months ago

Hello,

I can't figure out why the files coming from the package are poorly formatted, while those coming from the cdn are fine.

@basset(base_path('vendor/backpack/crud/src/resources/assets/css/common.css'))

this line give me : https://my-domain.com/var/www/my-app/vendor/backpack/crud/src/resources/assets/css/common.css?51f5b8a02400 instead of https://my-domain.com/storage/basset/vendor/backpack/crud/src/resources/assets/css/common.css?51f5b8a02400

same thing with common.js

karandatwani92 commented 2 months ago

Hey @dauvray

What do you mean by poorly formatted?

@basset() is meant to copy the files from cdn to the server's local storage storage/app/public/basset and serve from there only.

If you want to disable this behavior, add BASSET_DEV_MODE=true in .env to disable this feature.

dauvray commented 2 months ago

i have BASSET_DEV_MODE=true in .env when i say "poorly formatted" ( google trad ) i mean in my url you can see the path in my server : /var/www/my-app

I'm working with a fake domain name via my host file in windows to my nginx server. maybe this is the problem ?

karandatwani92 commented 2 months ago

Oh! Sorry I didn't notice that. can you share your .env's APP_URL & ASSET_URL?

dauvray commented 2 months ago

Sorry but ASSET_URL doesn't exists in my .env

karandatwani92 commented 2 months ago

Ok! We must ensure the APP_URL in your .env file is correctly pointing to the URL you use to access your application in the browser, for example http:127.0.0.1:8000 or http://something.test

please set that and try again.

dauvray commented 2 months ago

yes APP_URL is ok. I changed with a real domain name.

MicrosoftTeams-image (1)

Only this 3 files fails. i will reinstall new project but it's annoying. I would have liked to understand.

I also try to put this files in config/backpack/ui ( scripts & styles ) . it works but this error appears:

cURL error 28: Operation timed out after 10001 milliseconds with 0 out of 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/jquery/jquery-ui/archive/refs/tags/1.13.2.tar.gz

dauvray commented 2 months ago

finally I reinstalled a project and everything works, I don't understand what could have happened.

karandatwani92 commented 2 months ago

@dauvray Thanks for confirming. I was also unable to think of the cause. I'm glad you have it solved. Let me know if you find the cause; it may help others. Thanks