Skip to content

fix(web): resolve CHROME_EXTENSION_URL via the mapped @lib alias - #1648

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

fix(web): resolve CHROME_EXTENSION_URL via the mapped @lib alias#1648
Agnik47 wants to merge 1 commit into
supermemoryai:mainfrom
Agnik47:fix/web-repo-lib-constants-alias

Conversation

@Agnik47

@Agnik47 Agnik47 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Closes #1548

Problem

Three web components import the Chrome extension URL through an alias that nothing maps:

import { CHROME_EXTENSION_URL } from "@repo/lib/constants"
error TS2307: Cannot find module '@repo/lib/constants'
  or its corresponding type declarations.

apps/web/tsconfig.json maps @repo/ui/*, @ui/*, @lib/* and @hooks/* — but not @repo/lib/*. Resolution therefore falls through to the package's own exports map, {"./*": "./*"}, which points at the extensionless packages/lib/constants. TypeScript's bundler resolution does not append extensions after an exports-map substitution, so the import fails to type-check.

Webpack/Turbopack apply extension resolution more permissively, so these still bundle at runtime — but the imports are unsound and contribute to the red check-types run (#1544).

Fix

Switch the three imports to @lib/constants, matching every other consumer in the app:

  • 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

  • Isolated a tsc probe importing both alias forms against apps/web/tsconfig.json: only the @repo/ form raises TS2307; @lib/constants resolves cleanly.
  • @repo/lib/ now has 0 remaining occurrences repo-wide; @lib/ is already used in 233 places.
  • biome check passes on all three files.
  • No overlap with fix(web): clear the 84 type errors blocking check-types #1571, which touches a disjoint set of files.

Scope

This clears 3 of the errors tracked in #1544 — it does not by itself make check-types green.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ahq7SvSerSAVxkQR6GhuS

Three web components imported the Chrome extension URL through
`@repo/lib/constants`, an alias that nothing maps. `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 `{"./*": "./*"}`.
That points at the extensionless `packages/lib/constants`, and TypeScript's
`bundler` resolution does not append extensions after an exports-map
substitution:

  error TS2307: Cannot find module '@repo/lib/constants'
    or its corresponding type declarations.

Bundlers resolve extensions more permissively, so these still built at
runtime, but the imports were unsound and contributed to the red
`check-types` run.

Switch all three to `@lib/constants`, matching the 233 other uses of the
mapped alias across the app. `@repo/lib/` now has no remaining occurrences
in the repository.

Closes supermemoryai#1548

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ahq7SvSerSAVxkQR6GhuS
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