sonntam / node-red-contrib-xstate-machine

A xstate-based state machine implementation using state-machine-cat visualization for node red.
MIT License
22 stars 8 forks source link

Bug with {type: 'final'} node. #109

Open juan-carlos-rubalcaba-sanchez opened 2 months ago

juan-carlos-rubalcaba-sanchez commented 2 months ago

I was testing the library and I could not render the example:

https://github.com/sonntam/node-red-contrib-xstate-machine/blob/master/examples/machines/run-with-history.js

It seems to be an error with the {type: 'final'}.

Here the info error on Node-RED image

ERROR on console:

smcat renderer process exited with error code 1. 15 Jul 17:15:53 - [error] [smxstate:e3838b3d82487e60] Rendering of state machine failed: Render process returned error code 1: file:///D:/projects/test/src/node_modules/state-machine-cat/src/parse/smcat/smcat-parser.mjs:14 var self = Error.call(this, message); ^

peg$SyntaxError: Expected comment, end of input, line end, statemachine, or whitespace but "\"" found. at new peg$SyntaxError (file:///D:/projects/test/src/node_modules/state-machine-cat/src/parse/smcat/smcat-parser.mjs:14:20) at peg$buildStructuredError (file:///D:/projects/test/src/node_modules/state-machine-cat/src/parse/smcat/smcat-parser.mjs:556:12) at peg$parse (file:///D:/projects/test/src/node_modules/state-machine-cat/src/parse/smcat/smcat-parser.mjs:2686:11) at Object.getAST (file:///D:/projects/test/src/node_modules/state-machine-cat/src/parse/index.mjs:22:22) at Object.render (file:///D:/projects/test/src/node_modules/state-machine-cat/src/index-node.mjs:58:24) at file:///D:/projects/test/src/node_modules/state-machine-cat/src/cli/actions.mjs:37:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { expected: [ { type: 'other', description: 'whitespace' }, { type: 'other', description: 'line end' }, { type: 'other', description: 'comment' }, { type: 'other', description: 'statemachine' }, { type: 'other', description: 'whitespace' }, { type: 'other', description: 'line end' }, { type: 'other', description: 'comment' }, { type: 'end' } ], found: '"', location: { source: undefined, start: { offset: 0, line: 1, column: 1 }, end: { offset: 1, line: 1, column: 2 } } }

Node.js v20.14.0