Effect CommunityEC
Effect Communityβ€’3y agoβ€’
16 replies
imagio

Issues with Effect in Deno when using a CDN

More Deno woes. I still can't get effect to work properly in vscode deno via a cdn such as esm.sh. Simple repro here: https://github.com/evelant/deno_effect_test

Unfortunately I'm stuck loading all packages from URLs since my code runs on the supabase edge runtime which doesn't yet support npm specifiers.

Basically, with "effect": "https://esm.sh/effect@2.0.0-next.46?target=denonext" in import_map.json it seems types are broken

import { Context, Effect } from "effect";

interface Foo {
  bar: string;
}
const Foo = Context.Tag<Foo>();

/*
Argument of type 'Tag<Foo, Foo>' is not assignable to parameter of type 'Effect<unknown, unknown, unknown>'.
  Type 'Tag<Foo, Foo>' is missing the following properties from type 'Effect<unknown, unknown, unknown>': [EffectTypeId], [symbol], [symbol]deno-ts(2345)
*/
Effect.map(Foo, ({ bar }) => bar)
Was this page helpful?