fix(build): add tsconfig paths mapping for datavis submodule#167
Merged
fix(build): add tsconfig paths mapping for datavis submodule#167
Conversation
The DTS (type declaration) build was failing with TS2307 errors on all datavis/src/* imports in DataVisNITRO.tsx. The ESM/CJS build succeeded because tsup externalizes those imports via /^datavis\//, but TypeScript still needs to resolve the types for .d.ts generation. The root cause: TypeScript resolves datavis/src/* through pnpm's node_modules symlink chain, which can be fragile depending on the pnpm store state and link timing. Adding a paths mapping tells TypeScript to resolve directly to ./packages/datavis/src/*, bypassing the symlink entirely. Verified with a fresh clone: git clone → pnpm install → pnpm build produces ESM, CJS, and DTS output successfully.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The DTS build was failing with TS2307 errors on all datavis/src/* imports in DataVisNITRO.tsx. The ESM/CJS build succeeded because tsup externalizes those imports via /^datavis\//, but TypeScript still needs to resolve the types for .d.ts generation. The fix uses a split tsconfig strategy: - tsconfig.json (unchanged): used by 'tsc --noEmit' (typecheck) and IDE tooling. Does NOT include datavis/src/* paths, so it won't crawl into the datavis submodule's full source tree and error on its transitive dependencies (react-i18next, @dnd-kit/*, etc.). - tsconfig.build.json (new): extends tsconfig.json and adds a paths mapping for datavis/src/* -> ./packages/datavis/src/*. This lets TypeScript resolve the deep submodule imports directly without relying on pnpm's symlink chain. - tsup.config.ts: now sets tsconfig: 'tsconfig.build.json' at the root level so DTS generation uses the build-specific config. Verified with fresh clone: git clone -> pnpm install -> pnpm typecheck (passes) -> pnpm build (ESM, CJS, DTS all succeed).
Deploying ui with
|
| Latest commit: |
e6c578a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://34e1af71.ui-6d0.pages.dev |
| Branch Preview URL: | https://fix-tsconfig-datavis-paths.ui-6d0.pages.dev |
wreiske
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DTS (type declaration) build was failing with TS2307 errors on all datavis/src/* imports in DataVisNITRO.tsx. The ESM/CJS build succeeded because tsup externalizes those imports via /^datavis//, but TypeScript still needs to resolve the types for .d.ts generation.
The root cause: TypeScript resolves datavis/src/* through pnpm's node_modules symlink chain, which can be fragile depending on the pnpm store state and link timing. Adding a paths mapping tells TypeScript to resolve directly to ./packages/datavis/src/*, bypassing the symlink entirely.
Verified with a fresh clone: git clone → pnpm install → pnpm build produces ESM, CJS, and DTS output successfully.