joystick icon indicating copy to clipboard operation
joystick copied to clipboard

In development, add HTML validation and warn if there's a syntax error

Open rglover opened this issue 3 years ago • 3 comments

Right now if you have a syntax error (e.g., missing quote on an attribute), Joystick just renders "undefined" which is confusing. Worth trying to find a lightweight way to validate HTML and warn the developer on screen so it's not a goose chase.

rglover avatar Apr 16 '22 00:04 rglover

Bumping this. Just ran into a nasty one where a missing quote on an attribute caused a cascading failure in the render which led me on a goose chase. Any syntax errors should be caught post-HTML generation but pre-render. Should just throw a framework error and show steps to fix in the browser (similar to server side syntax errors).

rglover avatar Jun 20 '22 17:06 rglover

Give this package a spin when you get to this issue: https://www.npmjs.com/package/html-validate

rglover avatar Jun 20 '22 17:06 rglover

Bumping again. Just ran into one I got lucky on. I deleted a string literal passed to an attribute and forgot the ending } and the build system missed it. The browser was saying "} is an invalid attribute" and I only found it by tracing my steps back.

rglover avatar Jun 29 '23 16:06 rglover