Troubleshooting
Check the console first. When something is refused, a message is always logged; nothing fails silently.
INFO
Console messages are in Chinese, as printed by the framework. The left column gives the original text so you can match it.
Console messages
| Message starts with | Meaning | Fix |
|---|---|---|
端點設定缺失 / 端點設定格式錯誤 (endpoint config missing / malformed) | The page lacks endpoint config, or Blade and JS versions differ | Deploy Blade and front-end assets together, then reload |
…被拒絕 —— 這個元素不在任何 data-render-blade-object 裡面 (refused: not inside any object) | No object on the ancestor chain | Wrap it in @renderObject |
…被拒絕 —— 物件 "X" 的 data-render-allow 只有 [...] (refused: object only allows …) | The action isn't granted | Display needs state:read, writes need state:write, renders need render |
data-render-blade-object 需要名稱 (needs a name) | Empty value | Give it a name |
data-render-allow 有不認得的動作 X (unknown action X) | Typo | Only render, state:read, state:write exist |
data-state-class 需要 "key:class" 格式 (needs "key:class") | Missing colon | data-state-class="advanced:is-open" |
data-state-init:JSON 格式錯誤 (invalid JSON) | Starts with { but isn't valid JSON | Check the quotes, or use k=v |
…無法序列化,略過 (cannot serialize, skipped) | The value contains a function, DOM node or circular reference | Only store JSON-serializable data |
renderBladeAuto:容器需要 id (container needs an id) | The @renderAuto container has no id | Add an id |
The button does nothing at all
- Is there a "refused" message in the console? → see the table above
- Is
data-cg-eventmisspelled? (renderBladeis case-sensitive) - Is that event
imported inresources/js/app.js? - Did you insert this HTML yourself with
innerHTML? → without renderBlade it isn't re-bound - Are the front-end assets built?
The value is stored but the screen doesn't change
- You mutated a copy:
s.get('o').x = 1doesn't notify; uses.merge('o', { x: 1 }). - Same for arrays: use
s.update('list', (l = []) => l.concat(x)). - The display and the writer are in different namespaces. The same key under two objects is two values.
Text goes blank on load
When a key has no value, data-state-text falls back to the text written in the template. If it's really blank, usually:
- The template had no initial text → use
data-state-init="display=0" - Something called
set(key, ''): that really sets an empty string
State disappears after a re-render
- Did you press F5? A reload always resets it; that's by design.
- Did you switch tabs? Two tabs = two separate states.
- Did a full navigation happen?
pagehideclears it. page-mode navigation does not clear it. If state disappears in that case, it's a real bug.
A fragment is never unchanged
Does the fragment contain @linker? It generates a new uuid on every render. Move the mount point to an outer block.
Endpoints return 404 after an upgrade
Check the path in the Network panel. If it's still the old path, reload so Blade and JS share the same endpoint config. On multi-node deployments, confirm APP_KEY is identical everywhere.
bash
php artisan route:list --name=renderBlade