directus-labs / agency-os

The open source operating system for digital agencies. Built with Directus and Nuxt.
https://agencyos.dev
MIT License
604 stars 117 forks source link

Images cannot be loaded, files path not found #82

Closed aldoprogra closed 7 months ago

aldoprogra commented 7 months ago

Upload/Download a file not working:

{"errors":[{"message":"Route //assets/df0745c2-b6e3-4b37-b64d-55a4eb0033ab doesn't exist.","extensions":{"code":"ROUTE_NOT_FOUND","path":"//assets/df0745c2-b6e3-4b37-b64d-55a4eb0033ab"}}]}

I use postgres in railway and aws s3 buckets, permissions are okay, is enabled directus_files for the client and in directus files work find so aws works. I do not understand why the client look in the assets folder in which files are not stored, it should look into AWS bucket right? I can see the files there. How do I change it?

aldoprogra commented 7 months ago
Screenshot 2024-04-20 at 18 12 57
aldoprogra commented 7 months ago

Update: as you can see from the path Route //assets/df0745c2-b6e3-4b37-b64d-55a4eb0033ab doesn't exist.","extensions":{"code":"ROUTE_NOT_FOUND","path":"//assets/df0745c2-b6e3-4b37-b64d-55a4eb0033ab"}}]}

the route start with double backslash "//assets/.." if i modify it into "/assets/.." works. Does someone know how to modify this behaviour?

aldoprogra commented 7 months ago

update: I changed the source file in /modules/directus/runtime/composables/useFiles.ts in such function I removed the backslash "/", picture can be seen if I open in a new window but not in the dashboard of AgentOS

aldoprogra commented 7 months ago

update: I have applied the template with the url without the "/" it solved the problem.