opened
katonada
username_0
Hi,

I cannot install and invoke vue-cli-plugin-i18n neither with Vue-cli (3.rc3) and not with VueUI.
Tested on two computers (both: win10 home x64, node 8.10.0, npm 6.1.0, yarn 1.7.0).

**Steps to reproduce**
`vue add i18n`

**What is expected?**
```
📦  Installing vue-cli-plugin-i18n...

yarn add v1.7.0
[1/5] Validating package.json...
[2/5] , [3/5] Fetching packages..., [4/5] ..., [5/5] Building fresh packages...
.......... truncated
info All dependencies
├─ dotenv@6.0.0
├─ flat@4.0.0
└─ vue-cli-plugin-i18n@0.3.1
Done in 34.04s.

✔  Successfully installed plugin: vue-cli-plugin-i18n

? The locale of project localization. en
? The locale of project fallback localization. en
? Enable locale messages in Single file components ? No

🚀  Invoking generator for vue-cli-plugin-i18n...
```

**What is actually happening?**
After invoking I get error:
```
🚀  Invoking generator for vue-cli-plugin-i18n...
 ERROR  Error: Line 31: Unexpected token ...
Error: Line 31: Unexpected token ...
    at ErrorHandler.constructError (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:5004:22)
    at ErrorHandler.createError (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:5020:27)
    at JSXParser.Parser.unexpectedTokenError (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:1985:39)
    at JSXParser.Parser.throwUnexpectedToken (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:1995:21)
    at JSXParser.Parser.parseObjectPropertyKey (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:2492:33)
    at JSXParser.Parser.parseObjectProperty (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:2527:25)
    at JSXParser.Parser.parseObjectInitializer (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:2595:35)
    at JSXParser.Parser.inheritCoverGrammar (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:2278:37)
    at JSXParser.Parser.parsePrimaryExpression (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:2347:38)
    at JSXParser.parsePrimaryExpression (C:\Users\davor\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\esprima\dist\esprima.js:466:97)
```

**Maybe will help:** same thing is happening with `vue-cli-plugin-django` but `vue-cli-plugin-vuex-module-generator` works fine when invoked
Invoking generator for vue-cli-plugin-i18n error (esprima)
issue
created
kazupon
username_1
Thank you for your reporting!

Hmm 🤔, In my enviroment (macOS High Sierra 10.13.5, Node v8.11.1, Yarn 1.6.0, NPM 5.6.0), it was not occured.
I cannot confirm it due to I have not windows OS.
comment
created
katonada
username_0
Hmm, I created a basic test project with Vue CLI then `vue add i18n` and on a new environment, everything works fine.

I'll try to find what is the problem with my project (based on Vue enterprise template - https://github.com/chrisvfritz/vue-enterprise-boilerplate), for now I'll copy files and changes from new CLI project.
The plugin seems to be OK

Sorry for inconvenience.
comment
closed
katonada
username_0
issue
created
katonada
username_0
OK, after fresh install of vue-enterprise-boilerplate, `vue add i18n` gives the same error.

After fresh install template from https://vuejs-templates.github.io/webpack/ with vue CLI, or by clonning plugin works fine so the problem is with enterprise boilerplate
comment
created
hanzlahabib
username_2
Same error i think its due to Enterprise Boilerplate
comment
created
ahmetunaz
username_3
i also had same problem with Enterprise Boilerplate and finally solved my issue with comment out these lines in vue.config.js:

devServer: {
    ...(process.env.API_BASE_URL
      ? // Proxy API endpoints to the production base URL.
        { proxy: { '/api': { target: process.env.API_BASE_URL } } }
      : // Proxy API endpoints a local mock API.
        { before: require('./tests/mock-api') }),
  }

to 

devServer: {
    /* ...(process.env.API_BASE_URL
      ? // Proxy API endpoints to the production base URL.
        { proxy: { '/api': { target: process.env.API_BASE_URL } } }
      : // Proxy API endpoints a local mock API.
        { before: require('./tests/mock-api') }), */
  }

spread operator (...) is cause of the error for my issue.
comment