fix(web): import Chrome extension URL through the mapped @lib alias - #1569
Open
rajarshidattapy wants to merge 1 commit into
Open
fix(web): import Chrome extension URL through the mapped @lib alias#1569rajarshidattapy wants to merge 1 commit into
rajarshidattapy wants to merge 1 commit into
Conversation
Three components imported `@repo/lib/constants`, which nothing resolves: apps/web/tsconfig.json maps @repo/ui/*, @ui/*, @lib/* and @hooks/* but not @repo/lib/*, so resolution fell through to the package's own exports map (`"./*": "./*"`) and landed on the extensionless `packages/lib/constants`. Bundlers paper over it; tsc reports TS2307 for all three. Use `@lib/constants`, the alias every other consumer in the repo already uses.
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.
Fixes #1548
Problem
Three components import the Chrome extension URL through an alias nothing can resolve:
apps/web/tsconfig.jsonmaps@/*,@ui/*,@repo/ui/*,@lib/*and@hooks/*— but not@repo/lib/*. Resolution falls through to the package's own exports map ({"./*": "./*"}), which points at the extensionlesspackages/lib/constants; the file isconstants.ts, andbundlerresolution does not append extensions after an exports-map substitution.Webpack/Turbopack are more permissive, so this still bundles at runtime — but
tsc --noEmitreports TS2307 on all three, part of what keepscheck-typesred (#1544).Fix
Switch the three imports to
@lib/constants, the alias every other consumer already uses (app/(app)/brain/page.tsx,components/app-experience.tsx,components/dashboard-view.tsx, …). Adding a fourth@repo/lib/*mapping for the same package would work too, but matching the existing convention is the smaller change.Files:
apps/web/components/integrations/chrome-detail.tsxapps/web/components/nova/nova-empty-state.tsxapps/web/components/onboarding/x-bookmarks-detail-view.tsxVerification
tsc --noEmitonapps/webbefore and after: the three TS2307 errors are gone and nothing new appears — the remaining errors are identical tomain.biome ci --changedexits 0.