Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error JS_Parse_Error #1465

Closed
DrMoriarty opened this issue Jan 26, 2017 · 4 comments
Closed

Build error JS_Parse_Error #1465

DrMoriarty opened this issue Jan 26, 2017 · 4 comments

Comments

@DrMoriarty
Copy link

DrMoriarty commented Jan 26, 2017

Hello!
My project can be built successfully in Debug mode (for iOS and Android). But when I disable debug mode and try to build I get this error:

Build Failed: Error
at new JS_Parse_Error (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1534:18)
at js_error (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1542:11)
at croak (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2089:9)
at token_error (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2097:9)
at unexpected (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2103:9)
at semicolon (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2123:56)
at simple_statement (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2314:73)
at eval (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2183:19)
at eval (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2136:24)
at block_ (eval at <anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2429:20)
at /Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/builder.js:1:1995
at /Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/builder.js:1:944
at Gulp.doneCallback (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:11735)
at Gulp.Orchestrator.stop (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:150:9)
at n (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:3990)
at Object.callback (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:5859)
at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:906:35
at _arrayEach (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:85:13)
at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:898:17
at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:44:16
at BrowserWindow.<anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/compiler.js:1:1276)
at BrowserWindow.g (events.js:286:16)
at emitOne (events.js:101:20)
at BrowserWindow.emit (events.js:188:7)

As far as I see uglify-js should throw new JS_Parse_Error with additional information in what file and where it has troubles. But I not see this information in CocosCreator log. It shows me only the stack log but not the content of thrown exception.

Also I can't modify library js files in order to add more verbose output because app.asar seems not to be a valid asar file:

bash-3.2$ asar list app.asar 
buffer.js:615
    throw new RangeError('index out of range');
    ^

RangeError: index out of range
    at checkOffset (buffer.js:615:11)
    at Buffer.readUInt32LE (buffer.js:677:5)
    at Pickle.getPayloadSize (/usr/local/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:192:24)
    at new PickleIterator (/usr/local/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:27:28)
    at Pickle.createIterator (/usr/local/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:144:12)
    at Object.module.exports.readArchiveHeaderSync (/usr/local/lib/node_modules/asar/lib/disk.js:91:31)
    at Object.module.exports.readFilesystemSync (/usr/local/lib/node_modules/asar/lib/disk.js:97:25)
    at Object.module.exports.listPackage (/usr/local/lib/node_modules/asar/lib/asar.js:174:15)
    at Command.<anonymous> (/usr/local/lib/node_modules/asar/bin/asar.js:42:27)
    at Command.listener (/usr/local/lib/node_modules/asar/node_modules/commander/index.js:301:8)

bash-3.2$ asar --version
v0.13.0

CocosCreator 1.3.3 for MacOS

@DrMoriarty
Copy link
Author

Finally I made debug build and run uglifyjs over build/jsb-default/src/* files. It shows me full error description so I fixed the issue.
It would be nice if you fixed the cocos creator build log or provided any another way to show full build log.

@jareguo
Copy link
Contributor

jareguo commented Jan 27, 2017

Thanks @DrMoriarty, Is it an error about ES6 used in plugin scripts?

@DrMoriarty
Copy link
Author

@jareguo Yes, it shows an error for every using let directive

@jareguo
Copy link
Contributor

jareguo commented Feb 13, 2017

Sorry you can not use ES6 in plugin scripts! you should transpile to ES5 by yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants