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

Error when using ES6/7 features #34

Closed
ilearnio opened this issue Mar 18, 2016 · 1 comment
Closed

Error when using ES6/7 features #34

ilearnio opened this issue Mar 18, 2016 · 1 comment

Comments

@ilearnio
Copy link

I have just installed it, seems t be a great plugin, but it gave me an error right away when I tried to rename a variable:

undefined:1534
    throw new JS_Parse_Error(message, filename, line, col, pos);
    ^
    Error
    at new JS_Parse_Error (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1526:18)
    at js_error (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1534:11)
    at parse_error (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1647:9)
    at Object.next_token [as input] (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1912:9)
    at next (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2012:25)
    at vardefs (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2433:48)
    at const_ (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2454:27)
    at eval (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2197:30)
    at eval (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2073:24)
    at eval (eval at <anonymous> (/Users/Admin/Library/Application Support/Sublime Text 3/Packages/JavaScript Refactor/js/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2827:23)

I reduced my code and found out the reason for this error. It seems that the package doesn't support ES6 strings, imports/exports, async/await etc. For example, this piece of code will fail:

import fs from 'fs'

const foo = `bar`
@ilearnio ilearnio changed the title Error when ES6 string is present in code Error when using ES6/7 features Mar 18, 2016
@s-a s-a added the duplicate label Mar 19, 2016
@s-a
Copy link
Owner

s-a commented Mar 19, 2016

#24

@s-a s-a closed this as completed Mar 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants