How to use the built-in component "Image" from "next/image" in a production environment? #373
Yukixieyuya821
started this conversation in
Show and tell
Replies: 2 comments 3 replies
-
Hi @Yukixieyuya821 , I'm not familiar with .ts, can you provide an equivalent for background.js? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi @Yukixieyuya821 there is a normal workaround for this issue. Just adding domain in the next.config.js file like here |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there, folks!!!
Recently, I've encountered an issue with using the built-in component "Image" from "next/image" in a production environment, where images are not loading correctly.
The issue occurs after packaging and installing the source code. Once opened, images fail to load.
The problem arises after running next export, as it generates static assets that cannot handle _next/image. This is because handling such requests requires a dependency on the Next.js server. To resolve this issue, you can redirect the URL to point to a Next.js server before sending the request. Of course, you must first deploy a Next.js server.
main/background.ts
After repackaging and reinstalling.
The images can now be loaded correctly on the page.
Beta Was this translation helpful? Give feedback.
All reactions