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

Uncaught Subscriptions field (.K) not defined for observable child Error only when using knockout.debug #41

Closed
jerackista opened this issue Nov 11, 2016 · 9 comments

Comments

@jerackista
Copy link

I have knockout 3.4.1 debug and reactor 1.3.7 and I get this error only when using debug version of knockout.

Uncaught Subscriptions field (.K) not defined for observable child
disposeWatcher @ knockout.reactor.js:233
watchChildren @ knockout.reactor.js:144
(anonymous) @ knockout.reactor.js:179
objectForEach @ knockout-3.4.0.js:62
watchChildren @ knockout.reactor.js:161
(anonymous) @ knockout.reactor.js:249

@bago
Copy link
Collaborator

bago commented Nov 11, 2016

First, try reactor 1.3.8 because I added support for KO 3.4.1 in 1.3.8.
Second: it's weird that you get a "K" error on the DEBUG version of knockout: I guess you missed something.. please double check what version of knockout you are using... try running "ko.DEBUG" in console to see if you really have a debug version of knockout and try "ko.version" to see the loaded version.

@Domysee
Copy link

Domysee commented Dec 13, 2016

I got the same error when disposing the subscription. Also only when using the debug version, but I'm using KO 3.4.0 and reactor 1.3.8.

@bago
Copy link
Collaborator

bago commented Dec 13, 2016

what does ko.DEBUG in console says?
can you create a jsbin/jsfiddle to show the isssue?

@Domysee
Copy link

Domysee commented Dec 13, 2016

ko.DEBUG is undefined.
I'll try to, but it may take a while, at the moment I don't have much time.
My fix for now is to just not use the debug version.

@bago
Copy link
Collaborator

bago commented Dec 13, 2016

Weird. KO 3.4.0 removed the ko.DEBUG variable... so we need a new way to detect debug vs compiled version... it seems that ko.subscriptions is a function defined only in DEBUG versions, so we may "stick" to that.

@bago bago closed this as completed in afe14ee Dec 13, 2016
@bago
Copy link
Collaborator

bago commented Dec 13, 2016

Hi I "blindly released" 1.3.9 with a fix to support debug versions of KO 3.4.0 and 3.4.1, that seems to have removed the ko.DEBUG variable export.

Please let me know if this fix your issue.

@jerackista
Copy link
Author

Yes it looks fine now for me. Thanx

@bago
Copy link
Collaborator

bago commented Dec 13, 2016

Thank you for reporting and for the final feedback!

@tamanugi
Copy link

tamanugi commented Nov 1, 2017

I got same error when using with knockout 3.4.2.
guess subscriptionsField change to F.

     var subscriptionsField;
    switch (typeof ko.subscription == 'function' || ko.version) {
    case true: subscriptionsField = '_subscriptions'; break;
    case '3.0.0': subscriptionsField = 'F'; break;
    case '3.1.0': subscriptionsField = 'H'; break;
    case '3.2.0': subscriptionsField = 'M'; break;
    case '3.3.0': subscriptionsField = 'G'; break;
    case '3.4.0': subscriptionsField = 'K'; break;
    case '3.4.1': subscriptionsField = 'K'; break;
-   case '3.4.2': subscriptionsField = 'K'; break;
+  case '3.4.2': subscriptionsField = 'F'; break;
    default: throw 'Unsupported Knockout version. Only v3.0.0 to v3.4.2 are supported when minified. Current version is ' + ko.version;

After correcting as described above it worked properly

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

4 participants