Skip to content

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

@ratomirjovanovic

Description

@ratomirjovanovic

Package version: @supabase/ssr@0.9.0

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/ssr@0.9.0.
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions