fuse-box/fuse-box

Compiler crash on x?.y()!

warrenfalk opened this issue · 0 comments

The following compiles:

const x = document?.getElementById("test")

But add a ! at the end and the compiler crashes the dev server:

const x = document?.getElementById("test")!
- TypeError: Cannot read property 'generate' of undefined
at createStatement (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/transformers/optionalChaining/OptionalChainingTransformer.js:233:35)
at onEach (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/transformers/optionalChaining/OptionalChainingTransformer.js:298:37)
at fn (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/transformModule.js:28:21)
at visitNode (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/nodeVisitor.js:35:9)
at visitNode (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/nodeVisitor.js:56:21)
at visitNode (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/nodeVisitor.js:49:25)
at visitNode (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/nodeVisitor.js:49:25)
at Object.nodeVisitor (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/nodeVisitor.js:70:5)
at Object.transformModule (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/core/transformModule.js:22:19)
at Object.transformCommonVisitors (fuse-box-npm-4.0.0-next.446-d50a38a5e3-31ae16dfe5.zip/node_modules/fuse-box/compiler/transformer.js:100:23)