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.

cannot use typescript definitions from npm package

See original GitHub issue

Describe the bug install the package by npm, nothing about typescript definitions.

To Reproduce Steps to reproduce the behavior:

  1. npm i html5-qrcode
  2. import Html5Qrcode from 'html5-qrcode'
  3. See error about typescript

Expected behavior

Generate the typescript definitions please.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mebjascommented, Oct 13, 2021

@EduardMcfly please send a PR if you have a working solution.

0reactions
mebjascommented, Oct 23, 2021

This should have been fixed in latest version - v2.1.0

Please reopen if this is still an issue.

@EduardMcfly Thanks the solution was greatly inspired from your work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript does not resolve definition file for npm package
The problem you have is due to your tsconfig.json tries to explicitly include the typing file. npm package typings ...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
We can now simply use npm and the Typescript compiler will implicitly take any type definitions installed inside the node_modules/@types folder ...
Read more >
types/jest - npm
This package contains type definitions for Jest (https://jestjs.io/). Details. Files were exported from https://github.com/DefinitelyTyped/ ...
Read more >
Documentation - Modules - TypeScript
Modules are executed within their own scope, not in the global scope; this means that variables, functions, classes, etc. declared in a module...
Read more >
How to use TypeScript in Node.js - Execute Program
ts test.ts:1:14 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i ...
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