Skip to content

Incorrect TypeScript types for class with moduleResolution: "nodeNext" #791

Open
@tobimori

Description

@tobimori

Do you want to request a feature or report a bug? bug

What is the current behavior?

CleanShot 2024-01-05 at 14 07 45@2x

import Pusher from "pusher-js"
const pusher = new Pusher("APP_KEY", { cluster: "eu" })

tsconfig

{
  "include": ["**/*.ts", "**/*.tsx"],
  "compilerOptions": {
    "lib": ["DOM", "DOM.Iterable", "ES2022"],
    "isolatedModules": true,
    "esModuleInterop": true,
    "jsx": "react-jsx",
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "resolveJsonModule": true,
    "target": "ES2022",
    "strict": true,
    "noImplicitAny": true,
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./app/*"],
      "@/components": ["app/components/index.ts"],
      "@/state": ["app/utils/state/index.ts"],
      "@/icon-name": ["types/icon-name.d.ts"]
    },
    "skipLibCheck": true,
    "allowImportingTsExtensions": true,
    "noEmit": true
  }
}

What is the expected behavior?

TypeScript would detect te class as expected.

Which versions of Pusher, and which browsers / OS are affected by this issue?
Did this work in previous versions of Pusher? If so, which?
tested with 8.4, 8.3, 7.6;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions