Effect CommunityEC
Effect Community3mo ago
5 replies
Tom Sherman

TypeScript error when adding `declaration: true`

I'm rewriting my project using Effect, using it for the first time so maybe i'm missing something...

I have a shared package in my monorepo that i want to build and output .d.ts and .js files. but when i add declaration: true in my tsconfig i get many errors like

src/schema.ts:106:36 - error TS4020: 'extends' clause of exported class 'SchemaService' has or is using private name 'Stream'.

106 export class SchemaService extends Effect.Service<SchemaService>()("core/SchemaService", {
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107   effect: schemaServiceImpl,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108 }) {}


this only happens when i have declration: true

i have a public reproduction here: https://github.com/lexicon-community/lpm/commit/a66b39d8fdadf3ffb11178b169ea6c35310523e6

check it out, pnpm i, and pnpm turbo build or open eg. packages/core/src/schema.ts to see the errors
Was this page helpful?