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

Fix cms-kontent example Next/Image domain error #37188

Merged

Commits on May 25, 2022

  1. Fix cms-kontent example Next/Image domain error

    * Fixes the following error in the `cms-kontent` example by implementing
      an `Image` component to wrap `Next/Image` with a custom loader.
    
    ```
    Invalid src prop ... hostname "assets-eu-01.kc-usercontent.com" is not configured under images in your `next.config.js`
    ```
    
    * This error is affecting both the `pages/index.js` and
      `pages/posts/[slug].js` routes.
    * Uses a custom loader rather than adding the Kontent asset domains to
      `next.config.js` as we can transform the images using the Kontent
      Delivery API directly rather than delegating this to the Next app web
      server.
    
    Ref:
    * https://nextjs.org/docs/messages/next-image-unconfigured-host
    * https://nextjs.org/docs/basic-features/image-optimization
    * https://meeg.dev/blog/using-the-next-image-component-with-kentico-kontent-assets
    * https://github.com/Kentico/kontent-starter-corporate-next-js/blob/b7c9ef588c2e316557095e3160e712a1220601f5/components/Image.js
    * https://kontent.ai/learn/reference/image-transformation/
    tommarshall committed May 25, 2022
    Configuration menu
    Copy the full SHA
    10ba4c5 View commit details
    Browse the repository at this point in the history