Skip to content

fix(web): import Chrome extension URL through the mapped @lib alias - #1569

Open
rajarshidattapy wants to merge 1 commit into
supermemoryai:mainfrom
rajarshidattapy:fix/web-lib-constants-alias
Open

fix(web): import Chrome extension URL through the mapped @lib alias#1569
rajarshidattapy wants to merge 1 commit into
supermemoryai:mainfrom
rajarshidattapy:fix/web-lib-constants-alias

Conversation

@rajarshidattapy

Copy link
Copy Markdown
Contributor

Fixes #1548

Problem

Three components import the Chrome extension URL through an alias nothing can resolve:

import { CHROME_EXTENSION_URL } from "@repo/lib/constants"

apps/web/tsconfig.json maps @/*, @ui/*, @repo/ui/*, @lib/* and @hooks/* — but not @repo/lib/*. Resolution falls through to the package's own exports map ({"./*": "./*"}), which points at the extensionless packages/lib/constants; the file is constants.ts, and bundler resolution does not append extensions after an exports-map substitution.

Webpack/Turbopack are more permissive, so this still bundles at runtime — but tsc --noEmit reports TS2307 on all three, part of what keeps check-types red (#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.tsx
  • apps/web/components/nova/nova-empty-state.tsx
  • apps/web/components/onboarding/x-bookmarks-detail-view.tsx

Verification

tsc --noEmit on apps/web before and after: the three TS2307 errors are gone and nothing new appears — the remaining errors are identical to main. biome ci --changed exits 0.

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.
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.

@repo/lib/constants does not resolve — three web components use an alias that isn't mapped

1 participant