greenpress / vuex-composition-helpers

A util package to use Vuex with Composition API easily.
https://www.npmjs.com/package/vuex-composition-helpers
MIT License
288 stars 32 forks source link

can't install on nuxt with @nuxtjs/composition-api@0.20.1 #37

Closed udisun closed 3 years ago

udisun commented 3 years ago

trying to run install getting dependancy tree issues:

npm install vuex-composition-helpers
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @vue/composition-api@1.0.0-rc.1
npm ERR! node_modules/@vue/composition-api
npm ERR!   @vue/composition-api@"1.0.0-rc.1" from @nuxtjs/composition-api@0.20.1
npm ERR!   node_modules/@nuxtjs/composition-api
npm ERR!     @nuxtjs/composition-api@"^0.20.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! vuex-composition-helpers@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @vue/composition-api@0.6.7
npm ERR! node_modules/@vue/composition-api
npm ERR!   peer @vue/composition-api@">= 0.4.0" from vuex-composition-helpers@1.0.22
npm ERR!   node_modules/vuex-composition-helpers
npm ERR!     vuex-composition-helpers@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
davidmeirlevy commented 3 years ago

Look at the Transpiling section in the docs. there are ways to fix it for SSR, also at Nuxt.

udisun commented 3 years ago

I have already looked at it the docs does not include any info on nuxt but from the official nuxt docs:

nuxt-transpile

and already added the relevant lines before reporting this issue:

build: {
    analyze: process.env.NODE_ENV !== 'production',
    extractCSS: process.env.NODE_ENV === 'production',
    transpile: ['vuex-composition-helpers'],
  },

I don't see how npm install is related to the transpile that happens on the webpack build phase

davidmeirlevy commented 3 years ago

Oh it looks like there are conflicts with the peer dependencies.

I think I'll remove them from the package since vue added several ways to retrieve the composition api package. Can you suggest a PR without the peer dependencies? (Also if you can check locally if it will work for you that way - it will be great!).

udisun commented 3 years ago

@davidmeirlevy done: https://github.com/greenpress/vuex-composition-helpers/pull/38

davidmeirlevy commented 3 years ago

Thanks!