Skip to content

fix: finish lang loader refactor so front webpack build resolves ./lang - #53

Merged
ArtyomSavchenko merged 1 commit into
developfrom
fix/lang-loaders-develop
Oct 12, 2026
Merged

ArtyomSavchenko merged 1 commit into
developfrom
fix/lang-loaders-develop

Conversation

@ArtyomSavchenko

Copy link
Copy Markdown
Member

Problem

rushx package for dev/prod (and the dist-build / qms-dist-build / uitest* jobs, e.g. run 38197527585 on staging-new) fails with 58 errors like:

Module not found: Error: Package path ./lang is exported from package .../@hcengineering/login-assets,
but no valid target file was found (see exports field in .../login-assets/package.json)

Cause

48be04e ("refactor lang usage to make webpack happy", ported from TraceX) changed the ./lang export of the *-assets packages from the lang/ directory to ./lib/lang.js and added import * as XLang from '…/lang', but only 3 of the addStringsLoader calls were switched to XLang.loadLang. The rest still use import(`@hcengineering/<pkg>/lang/${lang}.json`); webpack resolves that as a context on <pkg>/lang, which now points at a file, so resolution fails.

Fix

  • dev/prod/src/platform.ts, desktop/src/ui/platform.ts: use <Pkg>Lang.loadLang for every package whose ./lang export is ./lib/lang.js (adds the missing namespace imports). presentation, ui, communication-assets have no ./lang export and keep the JSON template import.
  • chat-assets: add the missing src/lang.ts (the export already referenced lib/lang.js).
  • inbox-assets: was skipped by the port; switched to the same lang.ts + ./lang export.

Validation

Linux, Node 22: rush install --to @hcengineering/prod, rush build --to @hcengineering/prod, then node ../../common/scripts/bash.js --script package in dev/prod → webpack 5.111.1 compiled successfully, done. Not re-run: desktop build and UI tests.

After merge, develop needs to be merged into staging-new again.

🤖 Generated with Claude Code

https://claude.ai/code/session_014MzfgQXRL2ntDzgvtoSh8Z


Generated by Claude Code

Commit 48be04e switched the "./lang" export of the *-assets packages from
the lang/ directory to ./lib/lang.js, but configureI18n() in dev/prod and
desktop still loaded strings with import(`@hcengineering/<pkg>/lang/${lang}.json`).
Webpack resolves that template import as a context on "<pkg>/lang", which
now maps to a file, so `rushx package` failed with 58
"Package path ./lang is exported ... but no valid target file was found".

- use <Pkg>Lang.loadLang for every package that exports ./lang -> lib/lang.js
  in dev/prod/src/platform.ts and desktop/src/ui/platform.ts
- add the missing src/lang.ts to chat-assets (export already pointed at it)
- port inbox-assets to the same lang.ts / ./lang export scheme

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014MzfgQXRL2ntDzgvtoSh8Z
Signed-off-by: ArtyomSavchenko <armisav@gmail.com>
@ArtyomSavchenko
ArtyomSavchenko merged commit 7b672ba into develop Oct 12, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant