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
However, from babel plugin transform UI5 side, it seems that such node is not skipped, leading to an error and impossibility to compile :
SyntaxError: C:\<my-interface>.ts: Unknown ExportNamedDeclaration shape. (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (C:\<my-project>\node_modules\@babel\core\lib\transformation\file\file.js:244:12)
at NodePath.buildCodeFrameError (C:\<my-project>\node_modules\@babel\traverse\lib\path\index.js:133:21)
at PluginPass.ExportNamedDeclaration (C:\<my-project>\node_modules\babel-plugin-transform-modules-ui5\dist\modules\visitor.js:244:18)
at newFn (C:\<my-project>\node_modules\@babel\traverse\lib\visitors.js:171:21)
at NodePath._call (C:\<my-project>\node_modules\@babel\traverse\lib\path\context.js:53:20)
at NodePath.call (C:\<my-project>\node_modules\@babel\traverse\lib\path\context.js:40:17)
at NodePath.visit (C:\<my-project>\node_modules\@babel\traverse\lib\path\context.js:90:31)
at TraversalContext.visitQueue (C:\<my-project>\node_modules\@babel\traverse\lib\context.js:110:16)
at TraversalContext.visitSingle (C:\<my-project>\node_modules\@babel\traverse\lib\context.js:79:19)
at TraversalContext.visit (C:\<my-project>\node_modules\@babel\traverse\lib\context.js:138:19) {
code: 'BABEL_TRANSFORM_ERROR'
For me, a quick win would be to skip visiting such node from the plugin. For instance, here we should add a check for the node type, like :
if (node.type === "ExportNamedDeclaration") {
return;
}
Maybe this is a bit to simple and would need some refinements ?
Any help would be welcomed, as I'm not confident with my AST parsing comprehension :-)
Best regards
The text was updated successfully, but these errors were encountered:
Hi,
We recently upgraded babel stack and started to have issues with Typescript integration. Basically, if a file only contains type declarations, like :
then Babel will type it as an
ExportNamedDeclaration
(see this fixture with input and output)
However, from babel plugin transform UI5 side, it seems that such node is not skipped, leading to an error and impossibility to compile :
For me, a quick win would be to skip visiting such node from the plugin. For instance, here we should add a check for the node type, like :
Maybe this is a bit to simple and would need some refinements ?
Any help would be welcomed, as I'm not confident with my AST parsing comprehension :-)
Best regards
The text was updated successfully, but these errors were encountered: