question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Types not available for react native

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
calebdrecommented, May 15, 2020

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

1reaction
special-charactercommented, Apr 30, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/react-native - npm
Start using @types/react-native in your project by running `npm i @types/react-native`. There are 463 other projects in the npm registry ...
Read more >
Next.js is not recognizing '@types/react' - Stack Overflow
When I try to run my Next. js app with npm run dev I get an error message saying that I don't have...
Read more >
Using TypeScript - React Native
TypeScript is a language which extends JavaScript by adding type definitions, much like Flow. While React Native is built in Flow, it supports ......
Read more >
Trouble with @types/react - Blog
Let's start with a TypeScript module for a React Native component. There is an error with the code, can you spot it? //...
Read more >
Static Type Checking - React
Flow is a static type checker for your JavaScript code. It is developed at Facebook and is often used with React. It lets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found