[BUGFIX beta] Fix 'on' modifier error message regression#21091
[BUGFIX beta] Fix 'on' modifier error message regression#21091crazylogic03 wants to merge 9 commits intoemberjs:mainfrom
Conversation
This restores the helpful error message when the 'on' modifier is used without a function callback, which was lost in a recent refactor.
crazylogic03
left a comment
There was a problem hiding this comment.
I have implemented a fix to restore the helpful error message when the
on
modifier is used without a function callback.
Estimated Asset SizesDiff --- main/out.txt 2026-02-13 16:38:38.000000000 +0000
+++ pr/./pr-22039263969/out.txt 2026-02-15 16:43:00.000000000 +0000
@@ -1,16 +1,16 @@
╔═══════╤═══════════╤═══════════╗
║ │ Min │ Gzip ║
╟───────┼───────────┼───────────╢
-║ Total │ 352.02 KB │ 203.77 KB ║
+║ Total │ 352.02 KB │ 203.83 KB ║
╚═══════╧═══════════╧═══════════╝
╔══════════════════════╤═══════════╤═══════════╗
║ @ember/* │ Min │ Gzip ║
╟──────────────────────┼───────────┼───────────╢
-║ Total │ 313.42 KB │ 181.95 KB ║
+║ Total │ 313.42 KB │ 181.89 KB ║
╟──────────────────────┼───────────┼───────────╢
-║ -internals │ 36.65 KB │ 26.23 KB ║
-║ application │ 13.23 KB │ 8.09 KB ║
+║ -internals │ 36.65 KB │ 26.22 KB ║
+║ application │ 13.23 KB │ 8.05 KB ║
║ array │ 13.01 KB │ 7.46 KB ║
║ canary-features │ 304 B │ 389 B ║
║ component │ 2.05 KB │ 1.64 KB ║
@@ -19,16 +19,16 @@
║ deprecated-features │ 31 B │ 77 B ║
║ destroyable │ 561 B │ 383 B ║
║ enumerable │ 259 B │ 387 B ║
-║ helper │ 1.08 KB │ 803 B ║
+║ helper │ 1.08 KB │ 811 B ║
║ instrumentation │ 2.43 KB │ 1.79 KB ║
-║ modifier │ 1.22 KB │ 966 B ║
+║ modifier │ 1.22 KB │ 965 B ║
║ object │ 35.94 KB │ 22.16 KB ║
║ owner │ 159 B │ 178 B ║
-║ renderer │ 630 B │ 492 B ║
-║ routing │ 59.33 KB │ 34.13 KB ║
+║ renderer │ 630 B │ 487 B ║
+║ routing │ 59.33 KB │ 34.1 KB ║
║ runloop │ 2.36 KB │ 1.5 KB ║
║ service │ 1 KB │ 845 B ║
-║ template │ 654 B │ 519 B ║
+║ template │ 654 B │ 541 B ║
║ template-compilation │ 429 B │ 366 B ║
║ template-compiler │ 123.08 KB │ 59.45 KB ║
║ template-factory │ 370 B │ 374 B ║
@@ -40,19 +40,19 @@
╔═════════════════╤══════════╤══════════╗
║ @glimmer/* │ Min │ Gzip ║
╟─────────────────┼──────────┼──────────╢
-║ Total │ 38.6 KB │ 21.82 KB ║
+║ Total │ 38.6 KB │ 21.94 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable │ 2.77 KB │ 1.39 KB ║
║ encoder │ 81 B │ 171 B ║
║ env │ 38 B │ 87 B ║
║ global-context │ 886 B │ 545 B ║
║ manager │ 977 B │ 608 B ║
-║ node │ 175 B │ 245 B ║
+║ node │ 175 B │ 260 B ║
║ opcode-compiler │ 1.11 KB │ 894 B ║
║ owner │ 159 B │ 202 B ║
║ program │ 252 B │ 301 B ║
║ reference │ 548 B │ 531 B ║
-║ runtime │ 10.32 KB │ 5.22 KB ║
+║ runtime │ 10.32 KB │ 5.32 KB ║
║ tracking │ 1.34 KB │ 1.16 KB ║
║ util │ 1.94 KB │ 1.68 KB ║
║ validator │ 15.75 KB │ 6.96 KB ║Details
|
|
@crazylogic03 looks like tests don't pass |
|
@crazylogic03 can you show a before and after of what you see in the browser after making this change? (for the changelog, it would be helpful to know what the specific problem being solved is) tyty! |
|
@NullVoxPopuli Before: After: |
|
@crazylogic03 legit thanks for looking in to this! new error phrasing looks good. what was the old error? |
|
Looks like on 6.10, we get "Cannot access bind of undefined" (not good lol) |
|
@NullVoxPopuli Yep, exactly! |
|
@NullVoxPopuli Can You Review merge this PR and All the Checks have passed |
|
Thanks for the review @NullVoxPopuli! I'm glad we could get this fixed. |
|
@kategengler Can You Review merge this PR and All the Checks have passed 🙂 |
This PR fixes a regression where the helpful error message for the 'on' modifier was lost when the callback is undefined or not a function.
It adds an explicit runtime check in DEBUG mode to ensure the callback is a function, and includes a reproduction test case to verify the fix.