Skip to content
Discussion options

You must be logged in to vote

Hi

The issue is the path used for images in the Next.js config file.

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  images: {
    loader: "akamai",
    path: "", // <----- THIS IS THE ISSUE
  },
};

module.exports = nextConfig;

You should have the path set to /

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  images: {
    loader: "akamai",
    path: "/",
  },
};

module.exports = nextConfig;

Why does it happen only on dynamic routes? Well it doesn't just happen in dynamic routes. It happens because of the path depth.

If you create pages/register/foo.js, the same issue happens.

The above is key because, when…

Replies: 10 comments 19 replies

Comment options

You must be logged in to vote
8 replies
@icyJoseph
Comment options

@icyJoseph
Comment options

@OgLuka
Comment options

@icyJoseph
Comment options

@zourdyzou
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@OgLuka
Comment options

@icyJoseph
Comment options

@OgLuka
Comment options

Answer selected by OgLuka
Comment options

You must be logged in to vote
2 replies
@hamonCordova
Comment options

@hamonCordova
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@daviancode
Comment options

@jean1190
Comment options

@Wimmind
Comment options

@Pnlvfx
Comment options

@daviancode
Comment options

Comment options

You must be logged in to vote
1 reply
@jean1190
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet