Referring to an empty hyperscript file throws an error

Open
#308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend, web-dev

Research direction

Reproduce the issue with a script element pointing to an empty /scripts._hs file, then inspect the parser path shown in the hyperscript-0.9.5-2839a7f.js stack trace, especially raiseParseError and parseElement. Done means an empty external hyperscript file no longer throws the reported RangeError.

Written by the indexing model from the issue text.

Description

Adding e.g. <script type_="text/hyperscript" src="/scripts._hs" /> when scripts._hs is empty results in e.g.

Uncaught (in promise) RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at hyperscript-0.9.5-2839a7f.js:1:9892
    at Object.c [as raiseParseError] (hyperscript-0.9.5-2839a7f.js:1:9939)
    at hyperscript-0.9.5-2839a7f.js:1:11322
    at hyperscript-0.9.5-2839a7f.js:1:9423
    at Object.i [as parseElement] (hyperscript-0.9.5-2839a7f.js:1:9535)
    at hyperscript-0.9.5-2839a7f.js:1:35679
    at hyperscript-0.9.5-2839a7f.js:1:9423
    at i (hyperscript-0.9.5-2839a7f.js:1:9535)
    at Object.l [as parseAnyOf] (hyperscript-0.9.5-2839a7f.js:1:9658)
Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.