Cannot import when index.d.ts file
This is largely a question about node compatibility as what I really want is to run my existing large node/typescript project in Deno so that I can get good jupyter integration. I've managed to figure things out to where they mostly work but am running into issues where my existing code uses the npm type-fest package to provide advanced typescript types.
So as an example, I have the following import in my code
I can't for the life of me get this to work.
Lets set the issue of node-compatibility aside as I'm not sure how relevant it is here. I get the following in just the straight-up repl as well
This seems to be because whats inside of there is
index.d.ts
not index.js
Interestingly, I can't do npm:type-fest/index.d.ts
either as it seems to error out at the 8th line which begins with export type
.
I'm honestly not sure if this is a bug, an expected behavior, a bug in type-fest or what. It doesn't seem like a type-fest issue as they don't seem to be doing anything wrong here, this is all perfectly normal typescript and idioms. I also know they've had some issues with deno in the past but they were resolved years agoGitHub
Can't import type-fest in Deno · Issue #16 · skypackjs/skypack-cdn
https://github.com/sindresorhus/type-fest // x.ts import { LiteralUnion } from 'https://cdn.pika.dev/type-fest' type City = LiteralUnion<'bj' | 'sz', string> export co...
0 Replies