Generated channel client fails noUnusedLocals without hooks
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- elixir, typescript
- Domain
- build-system, tooling
Research direction
Start by locating the generator code that emits executeActionChannelPush and the Channel import; the issue does not name their files, so search the repository for those generated strings. Reproduce with the empty manifest and the exposed-action case, then type-check the generated files with noUnusedLocals: true. Done means both cases compile without TS6133 diagnostics and codegen --check still passes.
Written by the indexing model from the issue text.
Description
Code of Conduct
- I agree to follow this project's Code of Conduct
AI Policy
- I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.
Versions
ash_typescript 0.19.3; TypeScript 7.0.2 and 6.0.3 (reproduced with both); Phoenix JS 1.8.16; @types/phoenix 1.6.8; Elixir 1.20.4; OTP 29.1.1
Operating system
Debian 12 (bookworm) x86_64
Current Behavior
Without channel hooks, generated executeActionChannelPush declares processedConfig but never uses it:
TS6133: 'processedConfig' is declared but its value is never read.
This occurs with an exposed action. An empty RPC manifest additionally produces an unused Channel import.
Reproduction
The smallest case uses an empty manifest:
defmodule MyApp.TypescriptManifest do
use AshTypescript.Manifest, otp_app: :my_app, domains: []
end
Configure generation without before/after channel hooks:
config :ash_typescript,
manifest: MyApp.TypescriptManifest,
output_file: "../web/src/lib/generated/ash_rpc.ts",
run_endpoint: "/rpc/run",
validate_endpoint: "/rpc/validate",
generate_phx_channel_rpc_actions: true,
generate_validation_functions: false
Run mix ash_typescript.codegen, then type-check the generated files in a Phoenix TypeScript project with noUnusedLocals: true.
Both processedConfig and Channel produce TS6133 errors. A separate manifest exposing one action still produces the processedConfig error.
Both generated outputs pass codegen --check; that confirms generator provenance, not TypeScript compilation success. noUnusedParameters produces no additional diagnostics.
Expected Behavior
Omit unused declarations/imports so generated clients pass noUnusedLocals without manual edits or unnecessary hooks.
- Dominant language
- Elixir
- Stars
- 103
- Forks
- 36
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ash-project/ash_typescript
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
ash-project/ash_typescript#114 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
ash-project/ash_typescript#103 · 2 comments ·
-
Control generation of custom typesMay be free again @jmac03 claimed this 52 days ago, and no pull request is open. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ash-project/ash_typescript#84 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 42/100
ash-project/ash_typescript#51 · 2 comments · 3 reactions ·
All issues in ash-project/ash_typescript
Similar issues
-
@swmansion/popcorn: published .d.ts files lack extensions on relative imports, breaking moduleResolution node16/nodenextPossibly taken @Huyvux12 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/popcorn#929 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ash-project/ash#3127 ·
Maintainers usually reply within 1 day
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wintermeyer/vutuv#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100