Skip to content

ChunkLoadError on localized routes after upgrade to 2.5.0 #1200

@Mr2201

Description

@Mr2201

Hi,

after upgrading from 2.4.0 to 2.5.0, the frontend breaks on localized routes (e.g. /de/scan).

What happens

On routes like /de/scan, the initial assets are loaded correctly from /build/*.
During runtime, however, the frontend tries to load split chunks from /<locale>/build/<chunk>.js (e.g. /de/build/1203.<hash>.js), which do not exist on the server.

This results in:

  • GET https://<host>/<locale>/build/1203.<hash>.js 404 (Not Found)
  • Refused to execute script … MIME type ('text/html')
  • Uncaught (in promise) ChunkLoadError: Loading chunk 1203 failed

After the chunk load failure, follow-up errors occur, e.g.:

  • ReferenceError: sidebarHide is not defined in Stimulus controller common--hide-sidebar

and parts of the UI break (e.g. the camera permission hint on the scan page collapses to a few pixels).

Direct check:

  • https://<host>/<locale>/build/1203.<hash>.js → 404
  • https://<host>/build/1203.<hash>.js → exists / should be served correctly

Page source hint

The <head> contains absolute asset paths, e.g.:

<script src="/build/runtime.<hash>.js"></script>
<script src="/build/app.<hash>.js"></script>

but <body> contains:

<body data-base-url="/de/" data-locale="de">

It appears that the runtime public path for dynamically loaded chunks is derived from the localized base URL, causing chunk requests to be prefixed with /<locale>/.

Expected behavior

Runtime-loaded chunks should be requested from /build/* regardless of the locale in the URL
(or the asset path should resolve correctly under /<locale>/build/*).

Environment

  • Part-DB Server: 2.5.0 (currently back on 2.4.0, which works)
  • Browser: Chromium-based

Thanks for looking into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions