Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/augment-websocket.ts has incorrect types #445

Closed
dmytro-kostiushko opened this issue Apr 20, 2022 · 2 comments
Closed

/augment-websocket.ts has incorrect types #445

dmytro-kostiushko opened this issue Apr 20, 2022 · 2 comments
Milestone

Comments

@dmytro-kostiushko
Copy link

dmytro-kostiushko commented Apr 20, 2022

If you have a tsconfigration option "strictNullChecks" set to true - typescript will throw a compilation error stating that
origOnClose is possibly null.

tsconfig.json


{
  "compilerOptions": {
    "target": "es5",
    "typeRoots": [
      "./types",
      "./node_modules/@types"
    ],
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "downlevelIteration": true,
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": [
    "src"
  ]
}

TypeScript error in /Users/admin/IdeaProjects/processing-application-react-app/node_modules/@stomp/stompjs/src/augment-websocket.ts(32,5):
Object is possibly 'null'. TS2531

30 |     this.close();
31 | 

32 | origOnClose.call(this, {
| ^
33 | code: 4001,
34 | reason: 'Heartbeat failure, discarding the socket',
35 | wasClean: false,

@kum-deepak
Copy link
Member

Consider for v7.

@kum-deepak kum-deepak added this to the v7 milestone Sep 1, 2022
@kum-deepak
Copy link
Member

The next version is compiled with strictNullChecks set. See commit 06ff8fc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants