Deno - how to import with typings?
See original GitHub issueHi. Great library. I am trying to use it in Deno, but can’t seem to get typings to work… I am importing via
import {PDFDocument} from "https://cdn.pika.dev/pdf-lib@^1.7.0";
and everything works, but I don’t have types imported, so I don’t have intellisense in VS code.
When I import this library for node project (via npm ), everything is fine.
Am I missing something?
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Types and Type Declarations | Manual - Deno
So I have mod.js and mod.d.ts . If I try to import mod.js into Deno, it will only do what I ...
Read more >How to pull typings in Deno - Stack Overflow
Create a typings/ folder. Run deno --types > typings/deno.d.ts . Deno would output a type definition file for the core API. Now the ......
Read more >How we converted our Node.js library to Deno (using Deno)
Writing a Deno-ifier · Rewrite the Node.js-style imports to the more explicit style Deno. · Swapping out all imports from adapter.node to adapter ......
Read more >Create your first module with Deno - Livio Brunner
js. TypeScript import error with Deno. The vscode-deno extension fixes these kinds of remote imports by caching the typings in a special directory....
Read more >Deno 1.17 Release Notes
Deno 1.17 adds JSON imports, import completions in the REPL, and much more.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Did too much investigation here, full details in the other Issue but the TLDR is:
?dtsto the end of imports from skypack.dev (formerly pika.dev)So
import { PDFDocument } from 'https://cdn.skypack.dev/pdf-lib@^1.11.1?dts';worksFollow-up
After some investigation, turns out that official VS Code plugin Deno by denoland is not working as it should. Reverting to VS Code plugin marked as deprecated [Deprecated] Deno by axetroy solved the issue.
Conclusion
There’s really no issue here with your library after all. Sorry to bother you and keep up the excellent work!