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

sub is not a function error if vuex dispatch is calling #1686

Closed
reznik789 opened this issue Feb 9, 2022 · 11 comments
Closed

sub is not a function error if vuex dispatch is calling #1686

reznik789 opened this issue Feb 9, 2022 · 11 comments

Comments

@reznik789
Copy link

reznik789 commented Feb 9, 2022

Version

6.0.2

Reproduction link

https://codesandbox.io/s/535kx57jpx

Steps to reproduce

Open vue tab in devtools. Call vuex dispatch method

What is expected?

dispatch method works as usual

What is actually happening?

The method throws an error
Uncaught (in promise) TypeError: sub is not a function


Vue version: 2.5.22. Browsers: Firefox and Chrome. OS: Ubuntu

@Akryum
Copy link
Member

Akryum commented Feb 9, 2022

Vuex 3.0.0 and 3.0.1 are not currently supported by the devtools. Try upgrading to at least Vuex 3.1.
https://codesandbox.io/s/vuex-store-forked-i772y?file=/package.json

@nickpapageo
Copy link

@Akryum is there any plan to fix this bug in Vuex 3.0.0 and 3.0.1? I have the same issue with Vuex 3.0.1

@estima92
Copy link

Experiencing same problem with vue@2.6.11 and vuex@2.1.2.
Is support planned for older versions of vue?

@Akryum
Copy link
Member

Akryum commented Feb 10, 2022

Since it's impossible to detect if the vuex version is below 3.1.0, I added a setting in the Vue 2 builtin plugin:

image

@Akryum Akryum closed this as completed in 26ac318 Feb 10, 2022
@Bosphoramus
Copy link

It is weird that devtools incompatibility breaks your app.

I would understand that the devtools wont work properly when they have to detect old vue versions, but i dont get why your app should break just because of that

@Akryum
Copy link
Member

Akryum commented Feb 23, 2022

Only very old versions of vuex break (prior to Vuex 3.1.0). It breaks because the action subscribers interface changed (before 3.1: single function, after 3.1: object with two before and after functions).

@Bosphoramus
Copy link

Bosphoramus commented Feb 23, 2022

Thanks for the explanation @Akryum ☺️

@edwardcxyz
Copy link

edwardcxyz commented May 3, 2022

Just in case anyone else runs into this issue and finds this thread, like I did...

If you are using Vue 2, the current version of Vue Devtools for Chrome breaks with the sub is not a function error. To resolve the issue, uninstall the current Vue Devtools and install the LEGACY Vue Devtools extension instead.

@Akryum
Copy link
Member

Akryum commented May 3, 2022

@edwardcxyz You need to toggle the 'Legacy Actions' in the Vue 2 plugin settings, see https://github.com/vuejs/devtools/issues/1686#issuecomment-1034789116

@FourSeventy
Copy link

This is a freaking joke right? How can JS even begin to take itself seriously when nonsense like this occurs.

@MaikeMota
Copy link

Just in case anyone else runs into this issue and finds this thread, like I did...

If you are using Vue 2, the current version of Vue Devtools for Chrome breaks with the sub is not a function error. To resolve the issue, uninstall the current Vue Devtools and install the LEGACY Vue Devtools extension instead.

Still having the same problem with the LEGACY version, but I found and tried the v5 and works fine for me now.

Heres the extension link for chrome in case anyone else needs that: vuejs-devtools-v5

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

8 participants