You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bear with me, this one is difficult to explain. More recently (ReSpec v35.1.0 -- June 2024), when ReSpec is invoked via the command line, some ReSpec processing errors result in [ERROR] undefined being reported to the console. This causes Github Actions to fail without providing a useful error. When the same file is processed through a graphic Chromium session, depending on the complexity of the ReSpec document, sometimes a more detailed error is reported, and sometimes no error is reported at all.
Given this basic ReSpec HTML document as input (only the citation for [[[PRIVACY-BY-DESIGN]]] matters, because processing it is what throws the error):
<!DOCTYPE html><html><head><metacharset="utf-8" />
<title>ReSpec citation bug v1.0</title><scriptsrc="https://www.w3.org/Tools/respec/respec-w3c"
class="remove"
defer></script><scriptclass="remove">// All config options at https://respec.org/docs/varrespecConfig={specStatus: "ED",editors: [{name: "Your Name",url: "https://your-site.com"}],github: "some-org/mySpec",shortName: "respec-citation-bug",xref: "web-platform",group: "vc",};</script></head><body><sectionid="abstract"><p>This is required.</p></section><sectionid="sotd"><p>This is required.</p></section><sectionclass="informative"><h1>Demonstration of Bug</h1><p>The bug appears when you cite [[[PRIVACY-BY-DESIGN]]].</p></section><sectionid="conformance"><p>
This is required for specifications that contain normative material.
</p></section></body></html>
Processing the document above leads to this error in a Chromium Version 121.0.6167.139 browser:
and this is what is reported when the same file is processed using the respec command line (via npx respec -s https://website.example/respec-bug.html -o index.html.built.html --verbose -t 60 -e):
and this is what it looks like in a Github Action failure:
I spent a bit of time and was able to track this down to the stringifyJSHandle call here:
... and that results in the [ERROR] undefined text being printed to the console when respec is invoked as a command line tool. The bug is triggered because the specref entry for [[[PRIVACY-BY-DESIGN]]] seems to be malformed (that's a separate problem I'll chase down on the specref repo). However, the browser console shows the error (sometimes), but the command line seems to swallow the error.
Expected behavior (e.g., it shouldn't crash):
The command line error should result in something that's more descriptive than [ERROR] undefined.
I did put in additional debug code and restructured the code a bit over an hour of trying to figure out where the issue was happening in ReSpec, and every now and then I could get a more detailed stack trace to appear, but it was sporadic (signalling some possible async issue) and I was trying out a few different debug approaches so I hesitate to guess at what is happening here.
Optional, steps to reproduce:
Use the HTML file provided above.
Run some variation of npx respec -s https://website.example/respec-bug.html -o index.html.built.html --verbose -t 60 -e on it.
You should see [ERROR] undefined printed out to the console with a not very useful stack trace.
This particular error was due to bad data being returned from Specref.
Will make ReSpec handle it correctly, not sure how though - should either try to accept it, or reject entirely. WDYT @marcoscaceres? https://api.specref.org/bibrefs?refs=PRIVACY-BY-DESIGN returns a string, instead of an object.
CLI will show error details instead of undefined with #4781.
Another improvement to CLI and errors comes with #4782.
Description of problem
Bear with me, this one is difficult to explain. More recently (ReSpec v35.1.0 -- June 2024), when ReSpec is invoked via the command line, some ReSpec processing errors result in
[ERROR] undefined
being reported to the console. This causes Github Actions to fail without providing a useful error. When the same file is processed through a graphic Chromium session, depending on the complexity of the ReSpec document, sometimes a more detailed error is reported, and sometimes no error is reported at all.URL to affected spec or repo:
https://github.com/speced/respec/blob/main/tools/respecDocWriter.js#L320
What happened (e.g., it crashed)?:
Given this basic ReSpec HTML document as input (only the citation for [[[PRIVACY-BY-DESIGN]]] matters, because processing it is what throws the error):
Processing the document above leads to this error in a Chromium Version 121.0.6167.139 browser:
and this is what is reported when the same file is processed using the respec command line (via
npx respec -s https://website.example/respec-bug.html -o index.html.built.html --verbose -t 60 -e
):and this is what it looks like in a Github Action failure:
I spent a bit of time and was able to track this down to the
stringifyJSHandle
call here:https://github.com/speced/respec/blob/main/tools/respecDocWriter.js#L320
... which is dealing with a
message
that has this form:... and that results in the
[ERROR] undefined
text being printed to the console when respec is invoked as a command line tool. The bug is triggered because the specref entry for [[[PRIVACY-BY-DESIGN]]] seems to be malformed (that's a separate problem I'll chase down on the specref repo). However, the browser console shows the error (sometimes), but the command line seems to swallow the error.Expected behavior (e.g., it shouldn't crash):
The command line error should result in something that's more descriptive than
[ERROR] undefined
.I did put in additional debug code and restructured the code a bit over an hour of trying to figure out where the issue was happening in ReSpec, and every now and then I could get a more detailed stack trace to appear, but it was sporadic (signalling some possible async issue) and I was trying out a few different debug approaches so I hesitate to guess at what is happening here.
Optional, steps to reproduce:
npx respec -s https://website.example/respec-bug.html -o index.html.built.html --verbose -t 60 -e
on it.[ERROR] undefined
printed out to the console with a not very useful stack trace.Breakpoint'ing or adding debugging statements around https://github.com/speced/respec/blob/main/tools/respecDocWriter.js#L320 might help.
/cc @iherman
The text was updated successfully, but these errors were encountered: