Skip to content

chore(neon-adapter): Compilation issues due to Typescript type mismatchΒ #13249

@thenovatasha

Description

@thenovatasha

Environment

 System:
    OS: Linux 6.14 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
    Memory: 6.50 GB / 14.99 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.20.0 - ~/.nvm/versions/node/v22.20.0/bin/node
    npm: 10.9.3 - ~/.nvm/versions/node/v22.20.0/bin/npm
    pnpm: 10.17.1 - ~/.nvm/versions/node/v22.20.0/bin/pnpm
  Browsers:
    Chrome: 140.0.7339.185
    Chromium: 140.0.7339.185

Reproduction URL

https://github.com/thenovatasha/next-auth-example

Describe the issue

NextJS project build fails due to Typescript errors between @neondatabase/serverless installed at the project root and @neondatabase/serverless isntall inside the adapter-neon package.

Root Cause

  • The @auth/neon-adapter currently depends on @neondatabase/[email protected]
  • Projects using the adapter are installing the latest version (1.0.1) according to the documentation for Auth.js V5 "Getting Started" (https://authjs.dev/getting-started/adapters/neon)
  • The neondatabase/serverless v1.0.1 uses improved types, but the functionality is backwards compatible.
  • This creates a type mismatch because both versions of the Pool type are being imported

Impact

  • TypeScript compilation failures in projects using the latest @neondatabase/serverless
  • Forces users to manually resolve version conflicts or use workarounds
  • Prevents seamless adoption of the latest Neon database improvements

Proposed Solution

Bump the dependency in @auth/neon-adapter to use @neondatabase/[email protected]

Compatibility Verification

The existing adapter code is fully compatible with version 1.0.1 because:

  • API Stability: The Pool interface and client.query() method signatures remain unchanged
  • Result Structure: result.rows and result.rowCount behavior is identical
  • No Breaking Changes: Version 1.0.1 introduced internal optimizations but maintained backward compatibility

Additional Context

  • Adapter Version: Current @auth/neon-adapter
  • Current Dependency: @neondatabase/[email protected]
  • Target Dependency: @neondatabase/[email protected]
  • Related: This is a maintenance update with no functional changes required

How to reproduce

clone repo link provided in the reproduction URL.
cd next-auth-example

Try to compile the file "bug_auth.ts", and you'll see the type mismatch.

Expected behavior

Expect: Program should compile properly.
Actual: Typescript error due to Type differences between neondatabase/serverless versions. The versions mismatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions