admin管理员组文章数量:1323734
When running Sencha cmd 6.5, and I get the following error:
[ERR] C2001: Closure Compiler Error (Parse error. undefined label "f") -- pression-input:1:4095
How can I locate the code at pression-input:1:4095
?
This happens when I include a custom javascript file in app.json
using:
"js": [
{
"path": "app.js",
"bundle": true
},{
"path": "custom.js",
"includeInBundle": true
}
],
The error disapears when I remove the reference to custom.js
in app.json
.
If I interpret the error correctly, it means that closure piler finds an error on line 1, character 4095 of the pression-input
. But the first line of custom.js
is not such long.
How can I locate the offending code ?
And by the way, what is an undefined label
in closure piler ?
When running Sencha cmd 6.5, and I get the following error:
[ERR] C2001: Closure Compiler Error (Parse error. undefined label "f") -- pression-input:1:4095
How can I locate the code at pression-input:1:4095
?
This happens when I include a custom javascript file in app.json
using:
"js": [
{
"path": "app.js",
"bundle": true
},{
"path": "custom.js",
"includeInBundle": true
}
],
The error disapears when I remove the reference to custom.js
in app.json
.
If I interpret the error correctly, it means that closure piler finds an error on line 1, character 4095 of the pression-input
. But the first line of custom.js
is not such long.
How can I locate the offending code ?
And by the way, what is an undefined label
in closure piler ?
3 Answers
Reset to default 4I had the same issue a year ago, and I was told you cannot locate it from the error message.
Assuming that you have already tried to open your unpiled project directly in the browser, and not getting a syntax error, there's not much you can do except narrowing it down further by splitting the custom.js content in two parts and check these independently.
In my case it was Ext.define
where should have been Ext.create
, and the syntax error is thrown because usage of Ext.define
is rewritten into other mands during generation of the pression-input
. Maybe if you look for this specifically, you can find it.
With Sencha Cmd 7.7.0 (at least) you can do:
sencha pile concatenate --input-js-version ANY --js-version ANY --output-file all.js
Followed by:
closure-piler --js all.js --js_output_file out.js
To get a good error message:
all.js:418012:59: ERROR - [JSC_PARSE_ERROR] Parse error. invalid arrow function parameters
418012| const focusedRowIndex = currentRowElements.flatMap([index,item] => item.id === focusedRow.id ? parseInt(index) : []).pop();
Install closure-piler
from your package manager brew
or choco
...
I faced similar problems too. I disabled pression in app.json file:
"testing": {
"pressor": {
//"type": "closure",
"type": "none",
"warningLevel": "quiet"
},
"output": "...."
}
And I separately checked the output app.js file with the piler (which can be downloaded):
java -jar closure-piler-v20210302.jar --js app.js --js_output_file piled_output.js
本文标签: javascriptSencha cmdclosure compiler error how to locate the offending codeStack Overflow
版权声明:本文标题:javascript - Sencha cmd, closure compiler error: how to locate the offending code - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742118790a2421595.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论