Skip to content

@decorator doesn't work out of box at @vue/[email protected] #1542

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

Closed
yozman opened this issue Jun 11, 2018 · 4 comments
Closed

@decorator doesn't work out of box at @vue/[email protected] #1542

yozman opened this issue Jun 11, 2018 · 4 comments
Labels
needs team repro We acknowledged your report and will soon try to reproduce it

Comments

@yozman
Copy link
Contributor

yozman commented Jun 11, 2018

Version

3.0.0-beta.16

Reproduction link

https://github.com/vuejs/vue-cli

Steps to reproduce

update @vue/cli-service from 3.0.0-beta.15 to 3.0.0-beta.16

What is expected?

work

What is actually happening?

not work


here is the error log

 ERROR  Failed to compile with 1 errors                     14:32:38

 error  in ./node_modules/beekit.site/components/AppLayout.js

Module parse failed: Unexpected character '@' (15:0)
You may need an appropriate loader to handle this file type.
| `;
|
> @Component({
|   template,
|

 @ ./node_modules/beekit.site/index.js 1:0-47 8:17-26
 @ ./src/router.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://10.1.27.111:8080/sockjs-
node (webpack)/hot/dev-server.js ./src/main.js
@yyx990803
Copy link
Member

Please provide an actual repro.

@yyx990803 yyx990803 added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Jun 11, 2018
@yozman
Copy link
Contributor Author

yozman commented Jun 12, 2018

@yyx990803
https://github.com/bugct/vue/commits/issues/1542

by the way,
could u plz give some advance for vuejs/vue#8312 ?

@yozman
Copy link
Contributor Author

yozman commented Jun 15, 2018

@yyx990803
still not work at 3.0.0-rc.2

@yozman yozman changed the title @decorator doesn't work out of box at @vue/[email protected] @decorator doesn't work out of box at @vue/[email protected] Jun 15, 2018
@LinusBorg LinusBorg added needs team repro We acknowledged your report and will soon try to reproduce it and removed needs reproduction This issue is missing a minimal runnable reproduction, provided by the author labels Jul 2, 2018
@haoqunjiang
Copy link
Member

FYI your reproduction compiles successfully with 3.0.0-rc.3, though it emits several errors from eslint-loader.
It is because ESLint does not natively support experimental ECMAScript language features, you need to config ESLint to use babel-eslint as its parser.
In the case of Vue apps, this option should be placed in parserOptions field.
So to solve this problem, run npm i -D babel-eslint and add these lines to pacakge.json:

"eslintConfig": {
    "root": true,
+   "parserOptions": {
+     "parser": "babel-eslint"
+   },

Or, you could just use TypeScript plugin for decorator support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs team repro We acknowledged your report and will soon try to reproduce it
Projects
None yet
Development

No branches or pull requests

4 participants