We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a Next.js app with CMS that can upload images, save images locally, and then display images on Next.js again.
I found that Next.js does not show images created at runtime, only images that exist at build time. So I tried this module. static file serving
I first set up next.config.js like this:
next.config.js
const withTM = require("next-transpile-modules")(["@fullcalendar"]) const withImages = require("next-images") module.exports = withImages( withTM({ async rewrites() { return [ { source: "/api/:slug*", destination: "http://golang:5000/api/:slug*", }, ] }, }) )
then I try to show my images with absolute url like this:
<img className="d-block w-100" src={require("/src/static" + url)} />
But it turns out not working, and shows An unexpected error has occurred..
Does anyone has any idea on why it does not work?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a Next.js app with CMS that can upload images, save images locally, and then display images on Next.js again.
I found that Next.js does not show images created at runtime, only images that exist at build time. So I tried this module.
static file serving
I first set up
next.config.js
like this:then I try to show my images with absolute url like this:
But it turns out not working, and shows An unexpected error has occurred..
Does anyone has any idea on why it does not work?
The text was updated successfully, but these errors were encountered: