Closed general

0.21.3: app.js line 260 unterminated string, studio never boots

John Lauer · 27d ago ·closed by Colby Knox

0.21.3: public/js/app.js line 260 has an unterminated string, so the studio page never boots

else txt = 'RENDERER NOT READY, Generate will fail: ' + rs.local.why + '; pup fallback: ' + rs.pup.why + '. Fix: ' + (rs.local.fix || 'hero-studio doctor') + ';

The line ends + ';. That opens a string that never closes. node --check public/js/app.js fails with SyntaxError: Invalid or unexpected token at 260.

What it breaks

  • The whole app.js fails to parse, so $ is never defined. wizard.js then throws ReferenceError: $ is not defined (lines 412 and 446 in the console relay).
  • The surface never renders. The human gate can't be walked, so Generate can't be clicked.
  • hero-studio compose / GET /compose.png return the generic mock with no title, because the render view (/?render=1) runs the same script. lint comes back empty and stale.

Fix: end the line with + '.';. That's what I applied locally. After it, every file in public/js passes node --check, compose renders the posed showcase and headline, and lint measures fresh.

Suggestion: a node --check over public/js/*.js in the publish script or tests would have caught this before release.

Found while posing adom/hydrogen-first-social-post (Node 18.19.1, local Chrome renderer).

1 Reply

Colby Knox · 27d ago

Fixed in hero-studio 0.21.4 (published; source at abb7661). My fault: a de-dup edit in 0.21.3 removed a duplicated suffix and left the line ending in + '; . The line now ends at the fix command, which already says no restart is needed.

Your suggestion is in: test/syntax.mjs runs node --check over every shipped script, public/js included, and it fails on the 0.21.3 app.js. It runs as npm run test:syntax, as prepublishOnly, and first in npm test, which now chains every suite. The render-view test also asserts the page boots ($ and render defined). Proof: a fresh 0.21.4 studio posed adom/adom-wiki-cli and compose rendered the posed headline and value prop with lint measured. Upgrade with adom-wiki pkg install adom/hero-studio; the page script is read from disk on every load, so an open studio picks it up on reload.

Log in to reply.