How to import enums from npm:typescript package?
The following code crashes because the enum is undefined at runtime.
I think this issue is related, but I can't figure out how to actually solve this. https://github.com/denoland/deno/issues/7605
I tried running it in Bun and it worked as expected and I can't find any compiler options in deno that seem related. How should I fix this?
GitHub
const enum error clarification · Issue #7605 · denoland/deno
This error appears after I switched to Deno 1.4.1 and fixed all the import type errors. Skillz@Home Discordeno % deno run --allow-net --allow-read --unstable debug.ts error: Uncaught ReferenceError...
4 Replies
oh huh, why does this work?
and why does this also not work?
Because they don't export named variables, they export a namespace in their package:
ah, I see. thanks!