vue-cli-plugin-i18n
vue-cli-plugin-i18n copied to clipboard
Generator error
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)
Thank you for your reporting! Sorry, Unfortunately I can't reproduce in my enviroments. 😞 What is your OS / Node / npm version?
related #19
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
Thanks! This issue was reproduced in my environment. I'll try to fix this issue!
Glad to hear that! Thank you! :hugs:
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).