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
Hi @ryyppy
When using asset modules, such as this:
const logo = new URL("./logo.png", import.meta.url);
It generates a pathname such as /_next/9e8f58ab9ed5bb679a21.png, however this returns a 404 error for me.
/_next/9e8f58ab9ed5bb679a21.png
After some investigation I found the output path for asset modules can be configured. I added the following to next.config.js:
next.config.js
config.output.assetModuleFilename = "static/images/[hash][ext][query]";
The generated pathname is now /_next/static/images/9e8f58ab9ed5bb679a21.png which displays successfully.
/_next/static/images/9e8f58ab9ed5bb679a21.png
What do you think?
I'm happy to raise a PR.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @ryyppy
When using asset modules, such as this:
It generates a pathname such as
/_next/9e8f58ab9ed5bb679a21.png
, however this returns a 404 error for me.After some investigation I found the output path for asset modules can be configured. I added the following to
next.config.js
:The generated pathname is now
/_next/static/images/9e8f58ab9ed5bb679a21.png
which displays successfully.What do you think?
I'm happy to raise a PR.
The text was updated successfully, but these errors were encountered: