Skip to content

Module resolution fails for TypeScript types due to missing "types" in package.json "exports" #242

Description

@CaarLo1337

Updated from 10.23.0 to 11.1.0 and got the following issue

When importing types from 'fsxa-api' in a TypeScript project, an error occurs:

Root Cause
The package.json defines an "exports" field that restricts module resolution to the main entry points (./dist/fsxa-api.es5.js and ./dist/fsxa-api.cjs.js), but does not include a "types" key to specify the TypeScript declaration file. This causes TypeScript's module resolution to respect the exports restriction and fail to access ./dist/types/index.d.ts, even though it's specified in the "types" field.

https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports

Suggested Fix
Update the "exports" field in package.json to include types:

"exports": {
  ".": {
    "types": "./dist/types/index.d.ts",
    "import": "./dist/fsxa-api.es5.js",
    "require": "./dist/fsxa-api.cjs.js"
  }
}

Activity

  1. jodeleit-es commented on Mar 11, 2026

    @jodeleit-es
    Collaborator

    Introduced by the fix for #238

    @CaarLo1337 This is the only change in v11.1.0, is it working for you with v11.0.0?

  2. added theissue type on Mar 11, 2026
  3. CaarLo1337 commented on Mar 11, 2026

    @CaarLo1337
    ContributorAuthor

    @jodeleit-es yes v11.0.0 works

    here is a fix #244
    (I tested it locally with our project and it works again.)

  4. jodeleit-es commented on Mar 12, 2026

    @jodeleit-es
    Collaborator

    Thank you for providing a PR, I will have a look.

  5. added a commit that references this issue on Mar 12, 2026
    c3cb570
  6. added a commit that references this issue on Mar 20, 2026
    653c99d
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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions