2

Can't optimize images on the fly from a remote website. Example:

<nuxt-img
  src="https://upload.wikimedia.org/wikipedia/ru/b/b7/Enterthematrix.jpg"
  format="webp"
/>

// nuxt.config.js
export default {
  image: {
    domains: ['https://upload.wikimedia.org']
  }
}

What am I doing wrong?

Makhnov
  • 71
  • 1
  • 8
  • What is not working? Did you checked the cache and the size in the network? – kissu Sep 17 '21 at 08:27
  • 1
    I cleared all of the caches. Has url like a /_ipx/f_webp/https://upload.wikimedia.org/wikipedia/ru/b/b7/Enterthematrix.jpg Pic is not displayed. – Makhnov Sep 17 '21 at 09:24

1 Answers1

0

I had the same question, when I review the document and finally found out.

Your domain is not valid: you don't need to include the http protocol so you should write like this (without http protocol)

export default {
  image: {
    domains: ['upload.wikimedia.org']
  }
}
kissu
  • 40,416
  • 14
  • 65
  • 133
larrykkk
  • 459
  • 8
  • 10