Deep-Symmetry/bytefield-svg

CLI Error - Could Not Resolve Symbol: Address

stricklandrbls opened this issue · 2 comments

Description

Running bytefield-svg -s <file> -o <file> or echo "<bytefield syntax>" | bytefield-svg -s" results the the error described in the issue title:

CLI Error Output:

$HOME/.local/lib/node_modules/bytefield-svg/lib.js:1163
function m_(a,b,c){if(gb(uY)){var d=b.message;if(m(d)){if(-1!=d.indexOf("[at"))throw b;c=F(c);var e=ta(c);c=zd.Gc(e,U,U.La(a));a=zd.Gc(e,S,S.La(a));if(m(m(c)?a:c))throw d=p.La(d),e=u(b_),e=m(e)?[p.La(e),", "].join(""):null,d=[d," [at ",e,"line ",p.La(c),", column ",p.La(a),"]"].join(""),On.Gc(d,ll.He(he([new h(null,4,[sC,it,U,c,S,a,Cv,d],null),Pn(b)])),b);}}throw b;}
                                                                               ^
Nn [Error]: Could not resolve symbol: Address [at line 2, column 11]
    at new Nn ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:675:26)
    at On.Gc ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:677:74)
    at On.Na ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:677:31)
    at l_ ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:1162:204)
    at k_ ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:1161:632)
    at $HOME/.local/lib/node_modules/bytefield-svg/lib.js:1199:324
    at H_ ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:1199:378)
    at J_ ($HOME/.local/lib/node_modules/bytefield-svg/lib.js:1230:44)
    at $HOME/.local/lib/node_modules/bytefield-svg/lib.js:1199:451
    at $HOME/.local/lib/node_modules/bytefield-svg/lib.js:356:81 {
  data: h {
    v: null,
    A: 3,
    l: [
      y {
        kb: null,
        name: 'type',
        la: 'type',
        yc: 1174270348,
        o: 2153775105,
        F: 4096
      },
      y {
        kb: 'sci',
        name: 'error',
        la: 'sci/error',
        yc: -979082803,
        o: 2153775105,
        F: 4096
      },
      y {
        kb: null,
        name: 'line',
        la: 'line',
        yc: 212345235,
        o: 2153775105,
        F: 4096
      },
      2,
      y {
        kb: null,
        name: 'column',
        la: 'column',
        yc: 2078222095,
        o: 2153775105,
        F: 4096
      },
      11
    ],
    Ie: null,
    o: 16647951,
    F: 139268
  },
  cause: null,
  description: undefined,
  number: undefined,
  fileName: undefined,
  lineNumber: undefined,
  columnNumber: undefined
}

Node.js v18.16.0

Reproduce

For STDIN my exact syntax was:

$: echo "(draw-column-headers)
(draw-box "Address" {:span 4})
(draw-box "Size" {:span 2})
(draw-box 0 {:span 2})
(draw-gap "Payload")
(draw-bottom)" | bytefield-svg -s

From FILE:

$: echo "(draw-column-headers)
(draw-box "Address" {:span 4})
(draw-box "Size" {:span 2})
(draw-box 0 {:span 2})
(draw-gap "Payload")
(draw-bottom)" >> byte.test

$: bytefield-svg -s ./byte.test

Expected Behavior

I expected the normal behavior for whatever these commands reproduce.

Desktop

  • OS: Pop OS 22.04 LTS
  • Java Version:
openjdk 11.0.19 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1)
OpenJDK 64-Bit Server VM (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1, mixed mode, sharing)
  • Project Version: Whatever the lastest version in the NPM repository is, as of June 30 2023.

I just noticed that the syntax from the CLI was being thrown off by the double-quotes in the terminal. Also, running my echo command removed the double quotes from the byte.test file.

Resolution

I inserted the double-quotes around the column indentifiers and everything worked as normal.

Thanks for letting me know you got this resolved! 😄