pusher-js: Types not available for react native

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

Bug / Feature… not sure

What is the current behavior?

I’ve installed pusher-js@5.0.3 and @types/pusher-js@4.2.2 I tried with just pusher-js, but didn’t get types. Based on this I almost didn’t open an issue here as I thought maybe typescript support wasn’t official. That being said I see work and issues around typescript so I decided to open this issue.

When using

import Pusher from 'pusher-js/react-native'

I get the following:

Could not find a declaration file for module 'pusher-js/react-native'. 'node_modules/pusher-js/react-native.js' implicitly has an 'any' type.
  If the 'pusher-js' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pusher-js`

What is the expected behavior?

Types work when using plain javascript and react-native.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@leesio false alarm - just found it was a bug in my code. was importing logger from pusher for some reason 😅

@leesio Thanks for releasing so quickly. That resolved the issue for me!

You’re absolutely correct @special-character, good spot and thanks for the PR