Skip to content

tsconfig.json: outDir without rootDir triggers TS6059 / migration warning when validated by IDE #209

Closed

Description

@ratomirjovanovic

Package version: @supabase/[email protected]

File: node_modules/@supabase/ssr/tsconfig.json

What's happening

The published tsconfig sets outDir: "dist/module" but does not set rootDir. When a consumer's IDE (VS Code, Cursor) validates this file as part of TypeScript's project model, it surfaces this warning on the line that references the source layout:

The common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

The relevant section of tsconfig.json:

{
  "include": ["src/**/*"],
  "compilerOptions": {
    "module": "preserve",
    "outDir": "dist/module",
    "sourceMap": true,
    "declaration": true
    // ...
  }
}

Why it matters

It does NOT break consumers' builds — the dist/ shipped in the npm tarball is fine. But:

  1. Every consumer who opens the node_modules/ folder (intentionally or via a code-search) sees a red squiggle on their IDE for a vendor tsconfig they cannot fix.
  2. The TypeScript emit semantics for outDir without an explicit rootDir are about to change (per the TS6059 migration guidance). Best to lock it in now while the dist is unaffected.

Suggested fix

Add "rootDir": "./src" next to outDir:

{
  "include": ["src/**/*"],
  "compilerOptions": {
    "module": "preserve",
    "outDir": "dist/module",
    "rootDir": "./src",
    // ...
  }
}

That's the migration the TS team recommends, and it makes the published config IDE-quiet.

Reproduction

  1. Fresh consumer project on TypeScript ^5.8 (or any version that emits TS6059 hints).
  2. npm install @supabase/[email protected].
  3. Open node_modules/@supabase/ssr/tsconfig.json in VS Code / Cursor.
  4. Hover over the compilerOptions block — the warning appears.

Thanks for the great library.

Activity

  1. added 2 commits that reference this issue on May 4, 2026
    a77ee8a
    9630b33
  2. added a commit that references this issue on Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions