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
var $jscomp$templatelit$2052066224$0 = $jscomp.createTemplateTagFirstArg(["aaa"]), $jscomp = $jscomp || {};
^
TypeError: Cannot read property 'createTemplateTagFirstArg' of undefined
at Object.<anonymous> (dist/bundle.js:1:48)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
The definitions of $jscomp and its methods are automatically injected at the start of the first input script / module.
When we transpile the template tag, we must declare the template tag arguments at the script / module level, so we put the declaration at the top of the current script / module.
Unfortunately, the tag is in the first script / module, so we end up putting the declaration before the definitions it depends on.
I believe the best fix is instead to traverse up the AST from the tagged template to find the module - level statement containing it and insert the declaration at that point instead.
Input:
Output (v20200426, SIMPLE):
Runtime error (in Node v12.16.3):
Correct output (v20200224):
The text was updated successfully, but these errors were encountered: