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.

Error: Could not find declaration file for module 'asn1'

See original GitHub issue

I am making a program in TS and while building this error pops up. Any idea why?

node_modules/ldapts/dist/filters/Filter.d.ts:2:38 - error TS7016: Could not find a declaration file for module 'asn1'. '.../node_modules/asn1/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/asn1` if it exists or add a new declaration (.d.ts) file containing `declare module 'asn1';`

2 import { BerReader, BerWriter } from 'asn1';

Same error also occurs for other .d.ts files like Attribute.d.ts, Change.d.ts, Control.d.ts

Btw there is no types for asn1

@jgeurts @adrianplavka

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jgeurtscommented, Jan 30, 2019

@Ashniu123, the PR with DefinitelyTyped was approved and I pushed out v1.2.3 that references the asn1 types from there. Hope that helps!

0reactions
jgeurtscommented, Jan 30, 2019

I have a PR to DefinitelyTyped to add the types. It sounds like it takes a couple days to be approved, but it should be there shortly. You can follow progress at https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32634

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'module-name ...
In order for this to work, I had to make declare module '...' the first line of code in the module.d.ts file, and...
Read more >
tsc: Could not find a declaration file for module 'asn1js'. #11
Try `npm install @types/asn1js` if it exists or add a new declaration (.d.ts) file containing `declare module 'asn1js';` 4 import * as asn1...
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >
Error: Could not find a declaration file for module - YouTube
Fix error : Could not find a declaration file for module ... implicitly has an 'any' type.Try npm install library-name if it exists...
Read more >
Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
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