basics / nuxt-booster

nuxt-booster will help you to improve the lighthouse performance score (100/100) of your website. 🚀
https://basics.github.io/nuxt-booster/
MIT License
666 stars 32 forks source link

SpeedKit Image issue in getImageSize function #887

Closed alghifarifikri closed 6 months ago

alghifarifikri commented 1 year ago

Describe the bug I got several issues when use <speedkit-image />.

  1. getImageSize: https://{IMAGE_URL} TypeError [ERR_INVALID_ARG_TYPE]: The "obj" argument must be an instance of Blob. Received an instance of Blob
  2. getImageSize: https://{IMAGE_URL} FetchError: (404 Not Found (https://{IMAGE_URL})) (In Docker Swarm)
  3. getImageSize: https://{IMAGE_URL} TypeError : body used already for: https://{IMAGE_URL} (In Docker Swarm)

To Reproduce Steps to reproduce the behavior:

  1. Install the package
  2. use speedkit image <speedkit-image v-bind="image" @load="onLoadImage" /> image: { source: { format: 'webp', src: this.url, sizes: { default: '100vw', xxs: '100vw', xs: '100vw', sm: '100vw', md: '100vw', lg: '100vw', xl: '100vw', xxl: '100vw' } }, title: this.title, alt: this.alt, }
  3. Run npm run dev
  4. See error

Expected behavior The images loaded successfully, and did not cause any errors, especially when using Google Lighthouse.

Desktop (please complete the following information):

ThornWalli commented 1 year ago

Hello @alghifarifikri,

which node version and nuxt are you using?

alghifarifikri commented 1 year ago

Hello @alghifarifikri,

which node version and nuxt are you using?

Hello @ThornWalli I'm using Node v16.16.0 and Nuxt 3.5.1

ThornWalli commented 1 year ago

@alghifarifikri Can you update your node to a newer version?

alghifarifikri commented 1 year ago

@alghifarifikri Can you update your node to a newer version?

@ThornWalli I haven't tried it, is the solution just to upgrade the node version ?

alghifarifikri commented 1 year ago

@alghifarifikri Can you update your node to a newer version?

image I'm try to update Node to new version and still error.

ThornWalli commented 1 year ago

Which node version did you go to?

I tested the project myself under Windows 10 with Node 19.9.0 and it runs as expected.

Your error message may be due to an outdated node version being used.

There were a few changes between Node 16 and 19.

alghifarifikri commented 1 year ago

Which node version did you go to?

I tested the project myself under Windows 10 with Node 19.9.0 and it runs as expected.

Your error message may be due to an outdated node version being used.

There were a few changes between Node 16 and 19.

I'm using node version 20, do I need to downgrade again?

ThornWalli commented 1 year ago

Extremely strange...

I also tested again with Node 20.9.0 and no problems...

Ran without problems, in the project repo and in a project with an installed package.

Could you share your installed dependency and the nuxt.config?

alghifarifikri commented 1 year ago

Extremely strange...

I also tested again with Node 20.9.0 and no problems...

Ran without problems, in the project repo and in a project with an installed package.

Could you share your installed dependency and the nuxt.config?

this is my dependency image

this is my nuxt.config for nuxt-speedkit image image

Let me know if anything is missing or wrong.

ThornWalli commented 6 months ago

I'm closing this issue for now. Let me know if this bug still exists 🙃