Issue with TypeScript Compilation Due to Missing _tag Property in Effect Service

Hello all 🙂

Can someone please help? I don't undertand why this won't compile without me specifically specifying a _tag property.
When I read through docs like https://effect.website/docs/requirements-management/layers/#config they don't seem to need to provide _tag. I've tried patterns like Layer.succeed etc with similar results.

Thank you in advance!

 typescript
export class MyService extends Effect.Service<MyService>()("MyService", {
  effect: Effect.gen(function* () {
    const authCodeFlowService = yield* RefreshableAuthorizationCodeFlowTokenService

    return {
      getUserClaims: () => authCodeFlowService.getClaims(),
    } 
  }),
  dependencies: [RefreshableAuthorizationCodeFlowTokenServiceLive],
})
{
  static Test =
    MyService.of({
      getUserClaims: () => Effect.succeed({}),
      
      // Why do I need this? 
      // TS will not compile Property '_tag' is missing in type '{ getUserClaims: () => Effect.Effect<{}, never, never>; }' but required in type 'MyService'.
      _tag: "MyService" 
      
    })
}
export const live = MyService.Default;
export const test = MyService.Test;




Perhaps this is an issue with my tsconfig?
 json
{
  "extends": "./.svelte-kit/tsconfig.json",
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "module": "nodenext",
    "moduleResolution": "NodeNext",
    "types": [
      "vitest/globals",
      "@testing-library/jest-dom"
    ],
    "exactOptionalPropertyTypes": false,
    "verbatimModuleSyntax": false,
    "isolatedModules": false,
    "plugins": [
      {
        "name": "@effect/language-service"
      }
    ]
  }
Effect Documentation
Learn how to use layers in Effect to manage service dependencies and build efficient, clean dependency graphs for your applications.
Was this page helpful?