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.

V3: Typescript missing type declarations

See original GitHub issue

When installing newest version (3.0.1) there seems that typescript declarations is missing. Get error: Cannot find module 'jose' or its corresponding type declarations.ts(2307)

Reproduce; npm install jose@3.0.1 Create typescript file: import { JWK, JWKS } from 'jose'; Typescript linter will complain of missing type declarations.

This worked on V 2.0.3.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
panvacommented, Jan 7, 2021

I have the same problem here, using node v12 and esm@3.2.25.

Your problem is not the problem here but rather, using an unmaintained and no longer supported ESM loader. ESM is now supported in Node.js LTS/12, LTS/14 and beyond so use it natively instead of the esm package.

0reactions
Dagrutcommented, Jan 7, 2021

I have the same problem here, using node v12 and esm@3.2.25.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Declare Missing Types for External Libraries
Custom Types Declaration#. First, in your tsconfig.json add a directory path to type declarations:.
Read more >
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 >
Missing type declaration files. Could not find a ...
When using the module in a TypeScript project, I get the error message Could not find a declaration file for module 'tiptap-vuetify'.
Read more >
Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >
How would I add a type for missing type data in a library ...
as you did in the type declaration file you are currently working in ... these imported types are now accessible to the typescript...
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