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

Problem with using typescript decorator #89

Open
hatedMe opened this issue Jul 6, 2023 · 4 comments
Open

Problem with using typescript decorator #89

hatedMe opened this issue Jul 6, 2023 · 4 comments

Comments

@hatedMe
Copy link

hatedMe commented Jul 6, 2023

import { Vue, Component, Prop } from "vue-property-decorator";
import Layout from "../Layout.vue";
@Component({
    components: {
        Layout,
    }
})
export default class extends Vue {
 // someing code 
}

Is there a feasible solution for the above code?

@drikusroor
Copy link

Hi @hatedMe I might have the same problem but I'm getting

Uncaught SyntaxError: Invalid or unexpected token (at SomePage.vue:39:1)

when I try to use vue-class-component. Is that the same error you are referring to?

@chessydk-vertica
Copy link

Hade the same problem and found out that I had enabled typescript decorators the wrong place, namely in tsconfig.app.json. It needs to go into your top level tsconfig.json - like this:

{
  "files": [],
  "compilerOptions": {
    "experimentalDecorators": true,
  },
  "references": [
    {
      "path": "./tsconfig.node.json"
    },
    {
      "path": "./tsconfig.app.json"
    }
  ]
}

@Fonigle
Copy link

Fonigle commented Apr 22, 2024

Hade the same problem and found out that I had enabled typescript decorators the wrong place, namely in tsconfig.app.json. It needs to go into your top level tsconfig.json - like this:

{
  "files": [],
  "compilerOptions": {
    "experimentalDecorators": true,
  },
  "references": [
    {
      "path": "./tsconfig.node.json"
    },
    {
      "path": "./tsconfig.app.json"
    }
  ]
}

it works, you saved my day! thanks! @chessydk-vertica

@chessydk-vertica
Copy link

chessydk-vertica commented Apr 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants