Skip to content

fix: error on new Maps app version install [DHIS2-20425]#3592

Merged
BRaimbault merged 6 commits intomasterfrom
fix/DHIS2-20425
Feb 3, 2026
Merged

fix: error on new Maps app version install [DHIS2-20425]#3592
BRaimbault merged 6 commits intomasterfrom
fix/DHIS2-20425

Conversation

@BRaimbault
Copy link
Copy Markdown
Collaborator

@BRaimbault BRaimbault commented Nov 28, 2025

Implements DHIS2-20425

Description

Bug

After updating the Maps app, some users encounter a runtime error:

TypeError: Failed to fetch dynamically imported module

This happens when the app attempts to load a lazily imported JS chunk that no longer exists on the server. The issue is most commonly triggered after installing a new app version without a hard refresh.

The root cause is unstable chunking during the Vite build: large dependencies (notably @dhis2/maps-gl) are re-chunked and re-hashed between releases. When combined with dynamic imports and browser/app-shell caching, this can leave the client requesting stale chunk filenames.

Fix

Force @dhis2/maps-gl into a dedicated, stable chunk using Rollup manualChunks via viteConfigExtensions.

This stabilizes the chunk graph across builds, significantly reducing the risk of stale dynamic imports after app upgrades. Once a user has successfully loaded a version containing this fix, subsequent updates should no longer trigger this error.


Quality checklist

Add N/A to items that are not applicable.

  • Dashboard tested N/A
  • Cypress and/or Jest tests added/updated N/A
  • Docs added N/A
  • d2-ci dependencies replaced (analytics or maps-gl link https://github.com/dhis2/[lib]/pull/XXX) N/A
  • Tester approved (BR)

Testing

Reproduce error:

  1. Install: 101.5.4
  2. Install: maps-999.99.9-install-test-nofix-rc1.2026-01-30

Test fix:

  1. Install: 101.5.4
  2. Install bundle with this fix: 999.99.9-install-fix-rc1.2026-01-30 (error can still happen)
  3. Install a new bundle: 999.99.9-install-test-rc1.2026-01-30 (no more error)

@dhis2-bot
Copy link
Copy Markdown
Contributor

dhis2-bot commented Nov 28, 2025

🚀 Deployed on https://pr-3592.maps.netlify.dhis2.org

@dhis2-bot dhis2-bot temporarily deployed to netlify November 28, 2025 12:21 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 16, 2025 09:41 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 30, 2026 10:07 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 30, 2026 10:47 Inactive
@BRaimbault BRaimbault marked this pull request as ready for review January 30, 2026 11:55
@dhis2-bot dhis2-bot temporarily deployed to netlify February 2, 2026 11:03 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify February 2, 2026 12:03 Inactive
@BRaimbault BRaimbault merged commit 5272de6 into master Feb 3, 2026
30 checks passed
@BRaimbault BRaimbault deleted the fix/DHIS2-20425 branch February 3, 2026 10:04
dhis2-bot added a commit that referenced this pull request Feb 3, 2026
## [101.5.5](v101.5.4...v101.5.5) (2026-02-03)

### Bug Fixes

* error on new Maps app version install [DHIS2-20425] ([#3592](#3592)) ([5272de6](5272de6))
@dhis2-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 101.5.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants