-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Page 404.html is not built when using internationalization #11011
Comments
I have the same problem but it's not just the 404 page but any top level pages in page/ |
My workaround: Create a // postbuild.js
const fs = require("fs").promises;
async function moveFiles() {
try {
await fs.rename("dist/en/404/index.html", "dist/404.html");
console.log("Files moved successfully!");
} catch (err) {
console.error("Error moving files:", err);
}
try {
await fs.rmdir("dist/en/404");
console.log("Directory removed successfully!");
} catch (err) {
console.error("Error removing directory:", err);
}
}
moveFiles(); Then add the following line to "scripts": {
"postbuild": "node postbuild.js",
} Works for me. |
Looks to me that it actually works. You can try to put the Removing the Though, this is a workaround. As the issue was labeled as important, we should probably wait for a fix soon. Astro is a very active project with frequent releases. Cudos for the Astro Team 🎉. |
I found an additional workaround that might be useful to some people. |
Nice that it works for you! For me it doesn't work because I want to prefix all locales, including the default "en" locale. |
@luciano-schirmer i prefix both en and ko (which is all of them) and it works fine |
@ematipico I don't think the problem is fixed. Not only does my project have the same issue when prefixDefaultLocale is set to true but the reproduction example by @luciano-schirmer still has the problem as well |
I inform that the problem was not fixed to me neither. I tried today and the problem persists. Had to rollback to my workaround using a postbuild script. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
build
Describe the Bug
Custom
404.html
page is not built todist
folder when using internationalization.This is my
astro.config.mjs
:And this is the relevant file structure:
Steps to reproduce the error:
The 404.html is not produced in the
dist
folder.What's the expected result?
404.html
file should be present indist
folder.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-plpmkk?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: