Sometimes when we try to build or deploy the JET application with the below two commands ..
a. ojet build --release
b. grunt build:release
..we get the below error stack.
node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)
at formatError (util.js:642:16)
at formatValue (util.js:544:18)
at inspect (util.js:324:10)
at format (util.js:191:12)
at Console.log (console.js:127:21)
at tooling.build.then.catch.error (C:\Users\AppData\Roaming\npm\nod
e_modules\@oracle\ojet-cli\lib\tooling\build.js:29:27)
at <anonymous>
message: 'Unexpected token: name (binary)',
filename: 0,
line: 239,
col: 22,
pos: 11651 }
At the first glance we might not be able to decide if the error is from the
a. Our developed source code
b. node_modules libraries
c. or the files in the directory structure : C:\Users\AppData\Roaming\npm\nod
e_modules
However by doing the modifying the below function in the file : /node-modules/uglify-js/lib/parse.js ...
.. we can get hold of token that is causing the issue.
{ SyntaxError: Unexpected token: name (binary)
at JS_Parse_Error.get (eval at <anonymous> (D:\node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)
Here binary is the culprit and we can search this keyword in our entire application and fix the issue.
In my case I was using an expression like below.. where in let keyword was not being identified by the build tools.
let binary = '';
Thanks,
Srikanth
Courtesy : Oracle community thread
a. ojet build --release
b. grunt build:release
..we get the below error stack.
node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)
at formatError (util.js:642:16)
at formatValue (util.js:544:18)
at inspect (util.js:324:10)
at format (util.js:191:12)
at Console.log (console.js:127:21)
at tooling.build.then.catch.error (C:\Users\AppData\Roaming\npm\nod
e_modules\@oracle\ojet-cli\lib\tooling\build.js:29:27)
at <anonymous>
message: 'Unexpected token: name (binary)',
filename: 0,
line: 239,
col: 22,
pos: 11651 }
At the first glance we might not be able to decide if the error is from the
a. Our developed source code
b. node_modules libraries
c. or the files in the directory structure : C:\Users\AppData\Roaming\npm\nod
e_modules
However by doing the modifying the below function in the file : /node-modules/uglify-js/lib/parse.js ...
- function unexpected(token) {
- console.trace() // HERE THE DIAGNOSTIC CHANGE TO DETERMINE THE FAILURE
- if (token == null)
- token = S.token;
- token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
- };
.. we can get hold of token that is causing the issue.
{ SyntaxError: Unexpected token: name (binary)
at JS_Parse_Error.get (eval at <anonymous> (D:\node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)
Here binary is the culprit and we can search this keyword in our entire application and fix the issue.
In my case I was using an expression like below.. where in let keyword was not being identified by the build tools.
let binary = '';
Thanks,
Srikanth
Courtesy : Oracle community thread
No comments:
Post a Comment