Missing 404.html when deploying localized Angular 18 app · Issue #192 · angular-schule/angular-cli-ghpages · GitHub
Skip to content

Missing 404.html when deploying localized Angular 18 app #192

Open

Description

@sondreb

I have an Angular 18 app that I've added the standard i18n (internationalization) support for Angular.

This means the output of my app are multiple folders with copies of the same app, in different languages.

When I now run deploy using this package, it no longer generates the 404 (not on root and not within the language folders).

Is there some option or something to make it work with localization?

Activity

  1. JohannesHoppe commented on Jun 14, 2024

    @JohannesHoppe
    Member

    We haven't changed any details here, the 404.html is still created?!

  2. sondreb commented on Jun 14, 2024

    @sondreb
    Author

    When moving from a single language to multi language app, it outputs "en", "no", "fr" sub-folders, each individual copies of the whole app. When doing the deploy, it doesn't create any 404 anymore (after I added multiple languages).

  3. JohannesHoppe commented on Jun 16, 2024

    @JohannesHoppe
    Member

    I see your point. The command wont copy the index.html to 404.html because it can't find it. There should be a warning message about this. Do you think you can come up with a solution for this? First we should recognise the different folder structure, then we should copy all the index.html files. PRs are highly welcome! 👍

  4. JohannesHoppe commented on Dec 30, 2025

    @JohannesHoppe
    Member

    Hey, just a quick update – we haven't forgotten about this!

    You're right that with i18n builds, there's no index.html in the root directory, only the locale subdirectories like en/, de/, etc. Our current 404.html creation just looks for index.html at the top level and fails silently when it's not there.

    We've discussed this for v2.1.0, but decided to focus on the gh-pages v6 upgrade and other breaking changes first. The i18n case adds complexity – we'd need to detect locale folders, handle different configurations, and make sure we don't break existing setups. We want to get this right rather than rush it.

    For now, you can work around this by creating the 404.html files manually in your build output before deploying, or using a post-build script.

    We'll keep this issue open for a future release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions