Skip to content

rootDir in base tsconfigs breaks workspace builds with ts-loader 9.5.7 #212

Closed

Description

@arbrandes

Description

When frontend-base is used as an npm workspace package (e.g. via bind mount in a consuming app), npm run dev fails with multiple TS6059 errors like:

[tsl] ERROR
      TS6059: File '/path/to/root/node_modules/@formatjs/intl/lib/index.js' is not under 'rootDir' '/path/to/root/packages/frontend-base'.

This happens because both tsconfig.json and tools/tsconfig.json set "rootDir": ".". In a standalone build this works fine since node_modules is inside the package directory. In a workspace, however, npm hoists dependencies to the root node_modules, which is above the package's rootDir.

This was previously masked by ts-loader, which overrode rootDir to undefined in its transpileModule() calls. ts-loader 9.5.7 removed that override (to fix a TypeScript 6.0 compatibility issue), so the tsconfig's rootDir now flows through and triggers the errors.

Since rootDir only controls output directory structure during emit, it doesn't need to be in the base tsconfigs used by ts-loader and webpack. The build tsconfigs (tsconfig.build.json and tools/tsconfig.build.json) either set their own outDir or inherit the correct structure via composite: true.

The fix is to remove rootDir from tsconfig.json and tools/tsconfig.json.

Fix

#213

LLM usage notice

Built with assistance from Claude.

Activity

  1. added theissue type on Apr 8, 2026
  2. self-assigned this
    on Apr 8, 2026
  3. moved this to In Progress in frontend-baseon Apr 8, 2026
  4. moved this from In Progress to Done in frontend-baseon Apr 8, 2026
  5. openedx-semantic-release-bot commented on Apr 8, 2026

    @openedx-semantic-release-bot

    🎉 This issue has been resolved in version 1.0.0-alpha.21 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions