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.

Typescript definitions missing from package

See original GitHub issue

Describe the bug

I see that there is a typescript definitions file on the repo (the .d.ts file), but seems that is not being pushed on the package.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new React app with typescript support (npx create-react-app new-app --typescript)
  2. Add the disqus-react package (npm install disqus-react)
  3. Usin VSCode, open App.tsx and import the module (import Discus from 'disqus-react';)
  4. See tooltip error on the imported part.

Expected behavior

Typescript definitions should load

Screenshots

image

Specifications:

  • OS: Windows 10 1903 (latest available version), running Ubuntu via WSL
  • Package version: 1.0.5
  • Node version: 12.4.0

Additional context

Looking at the package contents, seems that the .d.ts file is missing!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tterbcommented, Jun 28, 2019

@PedroLamas The PR containing the typescript definitions was just merged a few days ago, but I’m working on get the npm package updated today.

0reactions
bandinoplacommented, Nov 27, 2022

im getting Cannot find module 'disqus-react'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option? with "disqus-react": "^1.1.5" using typescript…

to solve this i added "moduleResolution":"node" to my tsconfig.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to include missing type definition files in typescript ...
I would suggest switching to types from typeRoots and using an include pattern rather than files . { "compilerOptions": { "lib": ["dom" ...
Read more >
How to Declare Missing Types for External Libraries -- newline
Custom Types Declaration#. First, in your tsconfig.json add a directory path to type declarations:.
Read more >
typescript definition is missing in npm package #4 - GitHub
redux-immer@1.0.3 package is missing the typescript definition file You can quickly see the actual file contents if you run npm pack ...
Read more >
How to add missing TypeScript definitions to third party ...
A quick note on how to add missing TypeScript definitions to third party packages.
Read more >
Vue with TypeScript - how to handle missing type definitions ...
Hi Folks, I have 3 or so Vue 2 projects where I chose Typescript (via cli scaffolding). For most the time it is...
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