Skip to main content

ts4023-effect-errors

Fix TS4023 when an exported Effect's error channel names a TaggedError from another module. Use when tsc reports "has or is using name 'X' from external module but cannot be named".

설치로 이동

소스 정보

저장소
forcedotcom/salesforcedx-vscode
최근 소스 활동
2026년 9월 17일 15:11
감지된 SKILL.md 언어
영어
스타
1,035
포크
454

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
ts4023-effect-errors
description
Fix TS4023 when an exported Effect's error channel names a TaggedError from another module. Use when tsc reports "has or is using name 'X' from external module but cannot be named".
review
never
# TS4023 with Effect Error Types TS4023 = exported Effect `.d.ts` names an error from **another module** that did not export it. Typical: a services method error leaks into a consumer command. Export only that class. Same-file, `catchTag`'d, or absent from an **exported** signature → leave unexported (`OrgNotDeletableError`, `ToastActionError`). **TS4023 message is misleading**: cites Effect internals (`Channel`, `Sink`, `Stream` from `effect/Cause`), not the missing error. ## Fix (defining module → consumer) 1. Find unexported TaggedErrors in the defining package (usually services): ```bash rg "class \w+Error extends (Data|Schema)\.TaggedError" packages/salesforcedx-vscode-services/src ``` 2. `export` the class that appears in the failing Effect's error channel: ```typescript export class EmptyComponentSetError extends Schema.TaggedError<EmptyComponentSetError>()('EmptyComponentSetError', {...}) {} ``` 3. Services public API — re-export from `index.ts`: ```typescript export type { EmptyComponentSetError } from './core/componentSetService'; ``` 4. Compile the **consumer** that failed: ```bash npm run compile -w packages/salesforcedx-vscode-metadata ``` ## Knip after a required same-package export TS4023 required `export` in a non-services package, knip flags it unused → tag: ```typescript /** @ExportTaggedError */ export class NoFilesRetrievedError extends Schema.TaggedError<NoFilesRetrievedError>()('NoFilesRetrievedError', { message: Schema.String }) {} ``` Knip unused on a TaggedError with no TS4023 → unexport; do not tag. Services errors are imported by other packages; knip already sees them used. No `@ExportTaggedError` there (`no-export-tagged-error-in-services`). ## Checklist - [ ] TS4023 actually reported - [ ] Export only the class in the exported Effect's error channel - [ ] Services: `export type { ErrorName }` from `index.ts` - [ ] Consumer compile passes - [ ] `@ExportTaggedError` only if knip flags that export unused (never in services)
GitHub에서 보기