Generated channel client fails noUnusedLocals without hooks

Open
#112 2 comments 0 reactions 0 assignees View on GitHub

@mossygrave is already working on this.

Since Nov 10, 2026.

  • #115 by @mossygrave — open

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

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

bug
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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ash-project/ash_typescript

All issues in ash-project/ash_typescript

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.