@xstate/effect: alpha.2 publish failed (E404), join on a machine types its error as unknown, typed oxlint plugin port
Agent-generated report. This issue was written by an AI coding agent (Claude, run by @joelhooks) while integrating
@xstate/effectinto a strict TypeScript project. Every claim below was checked against thenextbranch at 0748e1b, the Actions log linked, and a local build of the package. Joel reviewed it before filing; reply here and he will follow up.
Summary
Three findings from using @xstate/effect (XState 6.0.0-alpha.58, Effect 4.0.0-rc.115, Node 24, type-aware oxlint):
@xstate/[email protected]never reached npm. The Publish run for the alpha.58 release 404'd on it.- The docs say
joinon a machine fails with "the machine's typed error". A machine'sErrorFromisunknown, sojoin(machineActor)putsunknownin the error channel. scripts/oxlint-plugin-xstate-effect.mjscannot be lifted into a project that lints withtypescript/no-unsafe-*andstrict-boolean-expressions, because its AST walk is untyped. A TypeScript port on@oxlint/pluginspasses those rules and your ownlint.test.ts.
A patch covering 2 and 3 is attached as a gist; no PR was opened on purpose so you can decide how much of it you want.
1. Publish failure
The Version Packages (alpha) merge on next (0748e1b, 2026-09-17) published [email protected] but failed on the new package in the same run:
Some packages failed to publish:
@xstate/[email protected]
└ E404: 404 Not Found - PUT https://registry.npmjs.org/@xstate%2feffect - Not found
Publish command exited with code 1, but some packages were published: [email protected]Run: https://github.com/statelyai/xstate/actions/runs/35263063483
npm view @xstate/effect returns 404 today, so the README install line (npm install @xstate/effect@alpha) does not work. A 404 on the first PUT of a scoped package usually means the name is not yet provisioned for the publishing token or trusted publisher under the @xstate scope, not a problem with the package. Building packages/xstate-effect from the tag with preconstruct build && pnpm pack produces a working tarball with the expected peers (effect ^4.0.0-rc.115, xstate ^6.0.0-alpha.58), which is how it is being consumed in the meantime.
2. join and machine errors
Expected: the README's "Retries and supervision" section says join fails with the machine's typed error, so the schedule sees the actual failure.
Actual: join is typed Effect<OutputFrom<TActor>, ErrorFrom<TActor> | ActorStoppedError>, and ErrorFrom<Machine> resolves to unknown because any action or child can move a machine to the error status. So in a typed pipeline:
const inspectFile = Effect.fn("inspectFile")(function* (path: string) {
const actor = yield* createEffectActor(inspectMachine, { input: { path } });
const outcome = yield* join(actor); // E = unknown | ActorStoppedError
// ...
}, Effect.scoped);comes out as Effect<..., unknown, ...> and every caller loses its error typing. That matches the runtime model (a machine has no declared failure type), so this is a docs correction rather than a bug: the working pattern is to model domain failures as final states read from the machine output, and treat a machine-level error as a defect (Effect.orDie) or handle it with Effect.catchAll. The patch adds that paragraph to docs/observing-actors.md and reworks the two sentences in the README and docs/testing-and-errors.md that claim a typed machine error.
For what it is worth, the requirements side works as documented: RequirementsFrom collected FileSystem from a declared fromEffect actor and the missing-service case was a compile error.
3. Typed oxlint plugin
no-inline-effect is genuinely useful (it caught the discarded-Effect mistake on the first try), so lifting it into the consuming project was the obvious move. That fails under a type-aware config: context.report, node.type and the manual child walk all trip no-unsafe-call, no-unsafe-member-access, no-unsafe-argument and strict-boolean-expressions, because the .mjs has no types.
The port in the gist uses defineRule, definePlugin and ESTree from @oxlint/plugins, which oxlint already loads as a TypeScript plugin file on Node 22.18+. Rule logic, messages, enq/enqueue matching and the documented root-identifier limitation are unchanged; the only addition is a null-body guard on ESTree.Function. Verified in this repo:
@oxlint/plugins@^1.76.0added beside@preconstruct/cli(manypkg checkclean);pnpm-lock.yamlgains 9 lines.oxlintrc.json,test/lint-fixtures/oxlintrc.fixtures.json,src/lint.test.tsand the two docs mentions point at the.tsfilepnpm exec vitest run packages/xstate-effect/src/lint.test.ts: 2 passedpnpm lintandoxfmt --check: clean
Patch (git format-patch against 0748e1b): https://gist.github.com/joelhooks/99d193172a03609e67b4ef5849e8bbb1
Happy to turn any part of this into a PR if that is easier than applying the patch, or to drop the plugin part if you would rather keep it untyped.
Source: statelyai/xstate