vuejs/vuex

Can't resolve 'node_modules/vuex/types/index'

dschiller opened this issue · 1 comments

Version

4.0.2

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • In a nodejs app open app.js with VSCode and type "import create"
  • Select "createStore / node_modules/vuex/types/index" and press enter
  • Results in "import { createStore } from 'node_modules/vuex/types/index';"
  • Execute "npm run watch"
  • Fails with "Module not found: Error: Can't resolve 'node_modules/vuex/types/index' in '/var/www/vhosts/yourwebsite/httpdocs/resources/js'"
  • Change "import { createStore } from 'node_modules/vuex/types/index';" to "import { createStore } from 'vuex';"
  • "npm run watch" now works BUT autocompletion for the "store" is no longer available

What is expected?

"npm run watch" should work simultaneous with autocompletion

What is actually happening?

"npm run watch" works or autocompletion works, not both

I don't think this is an issue with Vuex. "import { createStore } from 'node_modules/vuex/types/index'" is not a valid. It should be import { createStore } from 'vuex'. I don't know why this autocompletion is happening to you, but I strongly suggest that it's your environment issue. Please use forum or Discord chat for questions 👍