Skip to content

TypeScript types not resolved for parse/node subpath imports #2848

@hajjarjoseph

Description

@hajjarjoseph

New Issue Checklist

Issue Description

TypeScript cannot resolve types when importing from parse/node (the recommended entry point for Node.js/server environments), even though types/node.d.ts exists in the package.

The package.json only declares the main types entry point ("types": "types/index.d.ts") but lacks typesVersions or exports mappings to make subpath imports (parse/node, parse/react-native) discoverable by TypeScript.

Steps to reproduce

  1. Create a TypeScript project with "strict": true
  2. Install parse package
  3. Import using the Node.js entry point:
    import Parse from 'parse/node';
  4. Observe TypeScript error

Actual Outcome

Could not find a declaration file for module 'parse/node'.

Expected Outcome

TypeScript should resolve types from types/node.d.ts when importing from parse/node.

Environment

Client

  • Parse JS SDK version: 8.0.0

Additional Context

The type definition files exist:

  • types/node.d.ts - exists and re-exports from types/index.d.ts
  • types/react-native.d.ts - exists and re-exports from types/index.d.ts

The types/tsconfig.json even has path mappings for internal testing, confirming this was the intended behavior:

"paths": {
 "parse": ["."],
 "parse/node": ["./node.d.ts"],
 "parse/react-native": ["./react-native.d.ts"]
}

Suggested fix: Add typesVersions and exports fields to package.json to expose these type mappings to package consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:released-alphaReleased as alpha versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions