vue-cli-plugin-i18n icon indicating copy to clipboard operation
vue-cli-plugin-i18n copied to clipboard

Generator error

Open indutny opened this issue 6 years ago • 6 comments

Hello!

Thanks for awesome library. Unfortunately, I can't use it with vue-cli, because of the following error. I'm getting this when running: vue add i18n:

 ERROR  Error: Line 81: Unexpected reserved word
Error: Line 81: Unexpected reserved word
    at ErrorHandler.constructError (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:5012:22)
    at ErrorHandler.createError (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:5028:27)
    at Parser.unexpectedTokenError (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:1985:39)
    at Parser.throwUnexpectedToken (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:1995:21)
    at Parser.parsePrimaryExpression (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:2390:38)
    at Parser.inheritCoverGrammar (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:2285:37)
    at Parser.parseLeftHandSideExpressionAllowCall (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:2899:26)
    at Parser.inheritCoverGrammar (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:2285:37)
    at Parser.parseUpdateExpression (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:3004:26)
    at Parser.parseUnaryExpression (/Users/findutnyy/.node/11.6.0/lib/node_modules/@vue/cli/node_modules/esprima/dist/esprima.js:3048:26)

indutny avatar Jan 14 '19 19:01 indutny

Thank you for your reporting! Sorry, Unfortunately I can't reproduce in my enviroments. 😞 What is your OS / Node / npm version?

kazupon avatar Jan 15 '19 01:01 kazupon

related #19

kazupon avatar Jan 15 '19 01:01 kazupon

Hello!

It is pretty easy to reproduce it with my project's repo:

git clone [email protected]:derivepass/derivepass-vue.git
cd derive-pass-vue
npm install
vue add i18n

indutny avatar Jan 15 '19 09:01 indutny

Thanks! This issue was reproduced in my environment. I'll try to fix this issue!

kazupon avatar Jan 15 '19 09:01 kazupon

Glad to hear that! Thank you! :hugs:

indutny avatar Jan 15 '19 09:01 indutny

As a result of investigation, it was caused by code due to dynamic importing of import of src/main.js.

I have reported to Vue CLI issue it. https://github.com/vuejs/vue-cli/issues/3309

In generally, src/main.(js|ts) with Vue CLI generated should not be wrote many codes. I recommend you should be wroten other js|ts file, and import to main.(js|ts).

kazupon avatar Jan 15 '19 17:01 kazupon