Does not work image optimization on an external website for @nuxt/image

Viewed 555

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?

1 Answers

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']
  }
}
Related