MartinMalinda / vue-concurrency

A library for encapsulating asynchronous operations and managing concurrency for Vue and Composition API.

Home Page:https://vue-concurrency.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatibility with vue 2.7

mdcarreira opened this issue · comments

After upgrading to vue:2.7, which has composition-api built in, I started getting this compilation error when running my app:

 ERROR  Failed to compile with 1 error                                                                                                                                 12:19:59 PM

 error  in ./node_modules/vue-concurrency/dist/vue2/vue-concurrency.module.js

Module not found: Error: Can't resolve '@vue/composition-api' in '/home/micael/code/webapp/node_modules/vue-concurrency/dist/vue2'

ERROR in ./node_modules/vue-concurrency/dist/vue2/vue-concurrency.module.js 1:0-140
Module not found: Error: Can't resolve '@vue/composition-api' in '/home/micael/code/webapp/node_modules/vue-concurrency/dist/vue2'
 @ ./node_modules/vue-concurrency/dist/index.module.js 1:0-45 1:0-45
 @ ./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/form/CFileUpload.vue?vue&type=script&lang=ts& 5:0-42 9:26-33
 @ ./src/components/form/CFileUpload.vue?vue&type=script&lang=ts& 1:0-252 1:268-271 1:273-522 1:273-522
 @ ./src/components/form/CFileUpload.vue 2:0-63 3:0-58 3:0-58 9:2-8
 @ ./src/components/ sync [A-Z]\w+\.(vue%7Cjs)$ ./form/CFileUpload.vue
 @ ./src/main.ts 99:21-81

Is there anything I'm missing to make this work? Or is vue-concurrency incompatible with vue:2.7?

Hello @mdcarreira it's quite possible the library is incompatible with vue 2.7. For a long time the situation was that in case of Vue 2 I had to require the @vue/composition-api module.

I had a lot of issues making the lib compatible with both Vue 3 and Vue 2. This actually makes it easier.

I think I'll support only Vue 2.7 in new version of vue-concurrency. But I'm swarmed with work, not sure if I can manage to do it in this or next week.

Hey @MartinMalinda, thanks for the fast reply!

Yeah, I understand. If I knew more about vue, I might try to give you a helping hand and make a PR. But unfortunately I'm a vue noob...

I'll keep watching your repo and crossing my fingers that you will find the time to look into it :)

@MartinMalinda, by any chance have you managed to look into this or plan to look into it soon?

Sorry for being insistent, but we've come into a point where we cannot upgrade to vue 3, neither want to downgrade back to vue < 2.7... So if you are not planning to update vue-concurrency to support vue 2.7, we will need to find an alternative solution :(

hi @mdcarreira, yes I gave it a try and unfortunately vue-concurrency does not run well in 2.7. Seems like the reactivity implementation there is different from the previous @vue/composition-api module because I'm seeing errors I haven't seen before with Vue 2.

I suspect this has something to do with its reactive implementation and maybe the errors point out some problems within my code, but I don't have time in the nearby future to refactor the lib:(

To be more precise, using a task leads to RangeError: Maximum call stack size exceeded. Seems like I'm not alone:
vuejs/vue#12750

Argh, that's a shame... Thanks for letting me know the current state of things!

commented

Is this fixed in the latest 2.7 release? I noticed there is handful of reactivity changes.

@Hawxy I just tried and yes, unfortunately

yes, unfortunately it's fixed? Why is that unfortunate?

A too quick answer from me, sorry. I mean the error is unfortunately still present. It's still going in infinite loop.