Skip to content

[solid 2.rc10] Dev warning when compiled output and @solidjs/web disagree on the delegated event key #3681

Description

@Azravos

Summary

When JSX is compiled by a pre-rc.9 compiler but runs on the rc.9+ runtime
(or vice versa), delegated events silently never fire. The app renders
normally with no errors or warnings, which makes the mismatch very hard to
diagnose.

Environment

  • solid-js / @solidjs/web: 2.0.0-rc.10
  • vite: 8.3.1
  • OS: Windows 11

How I hit it

The project depended on the deprecated vite-plugin-solid@3.0.0-next.27
shim. Its dependency on @solidjs/vite-plugin (^3.0.0-next.27) was
satisfied by an older plugin version already in node_modules, which npm
kept since it still matched the range. That plugin compiles with a
pre-rc.9 compiler.

Result

  • the app renders normally, no errors or warnings
  • <button onClick={() => alert('hej')}> never fires
  • in DevTools, the element has $$click set but not _$$click

This is the rc.9 change moving delegated handlers from $$<type> to
_$$<type>. Both sides behave correctly on their own; the pairing is
just silently broken.

Suggestion

In dev builds, one of:

  • have the document delegate warn once when it finds a $$<type>
    handler but no _$$<type> on the path (and the reverse in a 1.x-style
    check if feasible)
  • embed a compiler version marker in compiled output and have the dev
    runtime warn on mismatch

Either would turn a silent failure into an actionable message. Since the
rc.9 notes mention 1.x widgets on the same page also using $$<type>, a
warning limited to dev mode, or suppressible, would avoid false positives
there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions