Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirebaseError: Firebase Storage: Invalid URL for image urls set through firestore #550

Open
faizanabidnaqvi opened this issue Sep 15, 2023 · 1 comment

Comments

@faizanabidnaqvi
Copy link

If an entity has an image url set in the database that is not from the same firebase project and the field uses the 'storage' config, the image doesn't load in collection view and gives this error in the console:
FirebaseError: Firebase Storage: Invalid URL

For example, if an image field is set this way:

main_image: buildProperty({
            name: "Image",
            dataType: "string",
            storage: {
                storagePath: "images",
                acceptedFiles: ["image/*"],
                storeUrl: true,
            }
        }),

Now if we upload an image through firecms itself, the image preview shows fine in collection view.

However, now if I manually set the main_image to another link (not a firebase storage link or not a storage link from the same storage bucket e.g. https//abc.com/abc.png) directly through firestore, the image preview does not load and gives the error.

While this might not seem like a common scenario, it does occur if I am using the firebase emulator that contains image fields linked to a live project's storage rather than local storage.

@VisetDev
Copy link

VisetDev commented Feb 7, 2024

maybe related:
you have to set type on your file. In my case "image/jepg"

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants