IPX Bad request with firebase storage images (partially encoded url)
See original GitHub issueI’m trying to setup nuxt-image for my firebase-hosted images for my static site, and have done the following setup.
Edit: I was able to successfully use nuxt-image with a sample image from unsplash, but it didn’t work using my custom images from firebase. The problem seems to be how the image link is handled.
nuxt.config.js
target: 'static',
buildModules: ["vue-notion/nuxt", "@nuxtjs/prismic", '@nuxt/image'],
image: {
domains: ['https://firebasestorage.googleapis.com'],
// adding or removing alias didn't seem to change anything here
alias: {
google: 'https://firebasestorage.googleapis.com'
}
},
I then use nuxt-img here with one of my images
<nuxt-img
class="test"
src="https://firebasestorage.googleapis.com/v0/b/XXX.appspot.com/o/deals_images%2FKFC%2Fassets%2FKFC_Logo?alt=media&token=5f9afab6-1b8b-41e1-ac2d-83d83cad039c"
sizes="sm:100px md:200px lg:500px"
/>
However, I see this error in the console when i do npm run dev
and the image is missing.
GET http://localhost:3000/_ipx/w_200/https://firebasestorage.googleapis.com/v0/b/XXX.appspot.com/o/deals_images%2FKFC%2Fassets%2FKFC_Logo%3Falt=media%26token=5f9afab6-1b8b-41e1-ac2d-83d83cad039c 400 (IPX: Bad Request)
Am I missing anything to use nuxt-image to get responsive images for my static site?
Edit: Here’s another firebase storage image link to try, it still doesn’t work for me. Could it be something to do with firebase storage image URLs?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Get non-percent encoded URL from firebase storage
getDownloadURL() is giving me percentage encoded URLs from Firebase Storage. In this case I want to upload a file to the subfolder "images"....
Read more >Which one uses more online storage space for an app ... - Quora
Which one uses more online storage space for an app, images encoded using Base64 and stored as a string in JSON (in Firebase...
Read more >External Function Summary - Springer Link
Given a column reference to a BLOß in storage, returns the number of segments used to store it. Arguments value is the identifier...
Read more >Homepage :: CIS 527 Textbook
This website contains the course materials for CIS 527: Enterprise Systems Administration at Kansas State University. Anyone and everyone is welcome to review ......
Read more >DOOM Game Engine - Fabien Sanglard
To Romain Guy for taking the pictures of my 486 motherboard, ... Or even better, patch the book with a pull request since...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve came up with a solution on a fork I have on the ipx repo, which basically checks for firebase storage image URLs and handles them (slightly separately). I’ll probably put up a PR on the ipx repo end and link it over to this for reference.
I think ipx is decoding the url it gets so is making the request to firebase as
deals_images/Yole/Burger-King-Singapore-Promotion-October-2019-1024x1024.jpg
ipx provider encode src here https://github.com/nuxt/image/blob/main/src/runtime/providers/ipx.ts#L29 ipx decode here https://github.com/unjs/ipx/blob/main/src/middleware.ts#L31