Build crashes with "undefined is not an object (evaluating 'node.kind')" when using custom plugin · Issue #1619 · TypeScriptToLua/TypeScriptToLua · GitHub
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
{{ message }}
Repository navigation
Build crashes with "undefined is not an object (evaluating 'node.kind')" when using custom plugin #1619
Apologies for opening an issue again, turns out it wasn't a user error.
Since 1.29.0, using a custom plugin will cause building to fail with this error:
429 | expression.operand = operand;
430 | expression.operator = operator;
431 | return expression;
432 | }
433 | function isBinaryExpression(node) {
434 | return node.kind === SyntaxKind.BinaryExpression;
^
TypeError: undefined is not an object (evaluating 'node.kind')
at isBinaryExpression (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaAST.js:434:12)
at needsParenthesis (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:543:17)
at printExpressionInParenthesesIfNeeded (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:538:21)
at printTableIndexExpression (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:578:26)
at map (1:11)
at printVariableDeclarationStatement (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:286:68)
at printStatement (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:213:31)
at printStatementArray (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:200:31)
at printFile (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:155:35)
at printFile (D:\Programming\reaper-scripting-5\lib\reaper-api\dist\plugins\importFixPlugin.js:21:34)
at print (D:\Programming\reaper-scripting-5\lib\reaper-api\node_modules\typescript-to-lua\dist\LuaPrinter.js:95:37)
at processSourceFile (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\transpilation\transpile.js:66:33)
at <anonymous> (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\transpilation\transformers.js:13:9)
at transformSourceFileOrBundle (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:94907:49)
at transformation (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118154:14)
at transformRoot (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118177:71)
at transformNodes (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118162:56)
at emitJsFileOrBundle (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118707:24)
at emitSourceFileOrBundle (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118665:5)
at forEachEmittedFile (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118429:24)
at emitFiles (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:118647:3)
at <anonymous> (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:125759:13)
at runWithCancellationToken (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:50507:16)
at emitWorker (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:125757:37)
at <anonymous> (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:125728:13)
at runWithCancellationToken (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:125838:14)
at emit (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript\lib\typescript.js:125727:20)
at getProgramTranspileResult (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\transpilation\transpile.js:100:37)
at emit (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\transpilation\transpiler.js:27:100)
at performCompilation (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\tstl.js:90:86)
at executeCommandLine (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\tstl.js:61:13)
at <anonymous> (D:\Programming\reaper-scripting-5\fx-modulation-helper\node_modules\typescript-to-lua\dist\tstl.js:176:1
The following no-op plugin that does nothing will trigger the error:
I cannot reproduce this with the plugin and config you gave. Do you have a minimal TS file that reproduces the error?
Do you have any other plugins or transformers being executed on your code? The error looks familiar to me, but usually these always happen in combination with some transformer or plugins creating synthetic code.
Activity
Perryvw commentedon Feb 16, 2025
I cannot reproduce this with the plugin and config you gave. Do you have a minimal TS file that reproduces the error?
Do you have any other plugins or transformers being executed on your code? The error looks familiar to me, but usually these always happen in combination with some transformer or plugins creating synthetic code.