Skip to content

Throw a descriptive dev error when an action is called without useAction - #710

Merged
ryansolid merged 1 commit into
mainfrom
claude/solid-1x-release-ithwfa
Oct 30, 2026
Merged

ryansolid merged 1 commit into
mainfrom
claude/solid-1x-release-ithwfa

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Picks up #402 by @gabrielmfern. Calling an action(...) directly, without first going through useAction, currently fails with Cannot read properties of undefined (reading 'r'). This change throws an error that explains the fix instead.

Changes from #402:

  • The check is guarded with isDev from solid-js/web, so the message is dropped from production builds. Production still throws the old TypeError.
  • It uses "r" in this rather than Object.hasOwn, to avoid an ES2022 dependency.
  • The message is shorter.
  • There's a unit test. It fails on main and passes with the change. The full suite passes (282 tests), and so does tsc.

Generated by Claude Code

Based on #402 by the original author, guarded with isDev so the message
is dropped from production builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKAFH3mAnAwoGmZV3N
@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0463e40

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryansolid
ryansolid merged commit c3cbd67 into main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants