0

I have used npm to install both vue (2.4.2) and vuex (2.3.1). When I try to compile the below code I get the error:

enter image description here

Store.ts

import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);  // Error is thrown here

export default new Vuex.Store({
  // store here
})

tsconfig.json

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "experimentalDecorators": true,
    "lib": [
      "es2015",
      "dom",
      "es2015.promise"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "noImplicitAny": false,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5"

  },
  "exclude": [
    "./node_modules",
    "wwwroot",
    "./Model"
  ],
  "include": [
    "./CCSEQ",
    "./WebResources",
    "./sfc.d.ts"
  ]
}

I have seen this question, but doesn't have much helpful in it.

Why am I getting this error and how can I resolve it?

3
  • Did you find a solution? I am getting the same error and i dont know how to fix it either. Commented Nov 7, 2017 at 3:18
  • @MarekKnows.com I haven't figured it out yet. At this point I set my config to still build with errors so that I can continue to work. Not an ideal or long term solution, but for now it works. I'll post an answer when I figure it out. If you figure it out, I would appreciate you letting me know how you fixed it Commented Nov 7, 2017 at 13:40
  • I posted my solution below but now I have a new problem: stackoverflow.com/questions/47163495/… I don't suppose your getters have input arguments? Commented Nov 7, 2017 at 17:01

1 Answer 1

1

I found a solution. My vuex version was set to 2.3.1. As soon as I upgraded to use 3.0.1 then this problem went away.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.