No `exports` map, and the ESM build has extensionless imports Node can't load
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js, typescript
- Domain
- build-system
Research direction
Start in package.json, where main/module are set and exports is missing, then look at the build config (the tool producing dist/module) to see why relative imports are emitted without extensions. Compare against the exports maps in @supabase/storage-js and @supabase/postgrest-js as the template. Done looks like node --input-type=module -e "import('@supabase/ssr')" resolving to the ESM build and the per-module import no longer throwing ERR_MODULE_NOT_FOUND, with the CJS require path still working.
Written by the indexing model from the issue text.
Description
@supabase/ssr 0.12.7 has main and module but no exports map and no "type": "module". Node therefore always loads the CommonJS build, even from an ESM import. The module build can't be loaded by Node at all, because its relative imports have no file extension:
// dist/module/index.js
export * from "./createBrowserClient";
export * from "./createServerClient";
node --input-type=module -e "import('@supabase/ssr/dist/module/index.js')" fails with ERR_MODULE_NOT_FOUND.
The ESM build is only reachable through bundlers that read module. Server runtimes that don't bundle (Node, Bun, Deno via npm) run the CommonJS build, and ESM-only tooling (Vitest in some modes, tsx, Node's --experimental-strip-types workflows) gets CJS interop instead of real ESM.
Fix
Ship Node-valid ESM (.js extensions in relative imports, or .mjs output) and an exports map with import and require conditions, as @supabase/storage-js, @supabase/postgrest-js and @supabase/supabase-js already do. sideEffects: false is already set and can stay.
- Dominant language
- TypeScript
- Stars
- 216
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/ssr
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
cookies.setAll loses its receiver for stateful cookie adaptersPossibly taken @PhuocOng claimed this 71 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Stale host-only auth cookies survive a Domain migration and shadow the new sessionPossibly taken @RaphaelFakhri claimed this 30 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidofinance/validator-ejector#233 ·
Maintainers usually reply within 1 day
-
desktop: app-version.v1 in drafts.sqlite is never refreshed — reports 1.19.4 while running 2.3.2Openarea/desktop platform/windows type/feature version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
anomalyco/opencode#66079 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
ai-driven-qa bug claude Major
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linagora/twake-mail-admin#742 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-client#6728 ·
Maintainers usually reply within 1 day