Skip to content

Launching a single locale with subpath does not work without hacks #31675

Closed

Description

@vzarskus

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Building a single locale which has a subpath results in Angular not being able to "find" the correct server to launch.

Minimal Reproduction

Link to reproduction repo: https://github.com/vzarskus/locale-manifest-issue

This repo has 2 locales: "en" on no subpath and "lt" on /lt subpath.

Scenario 1: running full build with both locales works:
Steps:

  1. Run npm run build
  2. Run npm run serve:ssr:locale-manifest-issue
  3. Open it in the browser
  4. Try changing url in url bar to /lt and back to /
  5. Everything should work

Scenario 2: running just EN build works:
Steps:

  1. Run npm run build:en
  2. Run npm run serve:ssr:locale-manifest-issue
  3. Open it in the browser
  4. Works (EN page is displayed)

Scenario 3: running just LT build does not work:
Steps:

  1. Run npm run build:lt
  2. Run npm run serve:ssr:locale-manifest-issue
  3. Open it in the browser
  4. Does not work (LT page is not displayed neither on /lt nor on root url)

Looking at the compiled output of Scenario 3, I can find the culprit in dist/locale-manifest-issue/server/server.mjs getEntryPointExportsForUrl function:

getEntryPointExportsForUrl(t) {
  let { basePath: n } = this.manifest;
  if (this.supportedLocales.length === 1) return this.getEntryPointExports(''); // <---- Delete this line
  let r = cm(t, n);
  return this.getEntryPointExports(r) ?? this.getEntryPointExports('');
}

When there's a single locale, Angular always just assumes that the entrypoint is in server root. However, for LT locale, the entrypoint is actually in lt folder (dist/locale-manifest-issue/server/lt/main.server.mjs).
Deleting the line marked with "// <---- Delete this line" comment fixes the issue. Meaning that visiting /lt now works as expected.

Exception or Error


Your Environment

Node: 22.17.0
Package Manager: npm 11.4.2
OS: linux x64
    

Angular: 20.3.9
... common, compiler, compiler-cli, core, forms, localize
... platform-browser, platform-server, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2003.8
@angular-devkit/core         20.3.8
@angular-devkit/schematics   20.3.8
@angular/build               20.3.8
@angular/cli                 20.3.8
@angular/ssr                 20.3.8
@schematics/angular          20.3.8
rxjs                         7.8.2
typescript                   5.9.3

Anything else relevant?

No response

Activity

  1. self-assigned this
    on Nov 3, 2025
  2. added theissue type on Nov 4, 2025
  3. added 3 commits that reference this issue on Nov 4, 2025
    84fe8f5
    0a2e783
    f88086e
  4. added 2 commits that reference this issue on Nov 4, 2025
    5d76d84
    08e07e3
  5. added a commit that references this issue on Nov 4, 2025
    30efc56
  6. angular-automatic-lock-bot commented on Dec 5, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions