Skip to content

Published .d.ts files use extensionless relative imports, so NodeNext consumers get any types #214

Closed

Description

@Bccorb

Problem

The .d.ts files published for @seamless-auth/express, @seamless-auth/fastify and @seamless-auth/nextjs import siblings without extensions (for example from "./handler", from "./session", from "./options"). TypeScript projects using "moduleResolution": "NodeNext" (or Node16) cannot resolve those, so the exported function types (for example requireAuth) degrade to any. skipLibCheck: true, the default in most templates, hides the error, so consumers silently lose type checking rather than seeing a failure.

Found while fixing the request augmentation in #213, which fixed only the augmentation import (it now uses import "./types/express.js").

Reproduction

In a scratch project with "module": "NodeNext", "moduleResolution": "NodeNext", "strict": true, "skipLibCheck": false, install the published package and import requireAuth. tsc --noEmit reports the unresolved relative imports; with skipLibCheck: true the import types as any.

Fix options

  • Add .js extensions to every relative import in source (TypeScript keeps them in the emitted .d.ts), or
  • Bundle the declarations (for example tsup dts: true with a single entry) so there are no relative imports to resolve.

Extend the consumerTypes tests from #213 to assert a real function type (not only the augmentation) under NodeNext with skipLibCheck: false, for all three packages.

Activity

  1. added a commit that references this issue on Oct 13, 2026
    8ff942d
  2. added
    v0.19Targets the v0.19 release
    P1Next
    easyServes the easy-to-integrate promise
    on Oct 13, 2026
  3. added this to the v0.19 milestone on Oct 13, 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

    P1NextbugSomething isn't workingeasyServes the easy-to-integrate promisev0.19Targets the v0.19 release

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions