Skip to content

JS ERROR Error: not implemented #345

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

Closed
NickIliev opened this issue Jul 14, 2016 · 3 comments
Closed

JS ERROR Error: not implemented #345

NickIliev opened this issue Jul 14, 2016 · 3 comments

Comments

@NickIliev
Copy link

From @chiefmc on July 13, 2016 17:49

Hello there,

i'm getting hard times getting a pretty simple code to work in NativeScript 2.1.1 - Angular 2 2.0.0-rc3:

let headers = new Headers();
        headers.append("Content-Type", "application/text");

        this._http.get(
            "https://v-ticket.com.ua/api/Login/__pass=c84a0f0b2bb8e1c6bfb565c92a4ad4a9",
            { headers: headers }
        )
            .subscribe(
                res => console.log(res.json()),
                err => console.log(err.json())
            );

After the launch the app crashes with the following log:

Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: CONSOLE LOG file:///app/tns_modules/@angular/core/src/facade/lang.js:360:16: EXCEPTION: Error: not implemented
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: CONSOLE LOG file:///app/tns_modules/@angular/core/src/facade/lang.js:360:16: STACKTRACE:
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: CONSOLE LOG file:///app/tns_modules/@angular/core/src/facade/lang.js:360:16: getCookie@file:///app/tns_modules/@angular/platform-server/src/parse5_adapter.js:619:77
    configureRequest@file:///app/tns_modules/@angular/http/src/backends/xhr_backend.js:150:91
    createConnection@file:///app/tns_modules/@angular/http/src/backends/xhr_backend.js:165:44
    httpRequest@file:///app/tns_modules/@angular/http/src/http.js:22:36
    ngOnInit@file:///app/pages/event-list/event-list.component.js:24:23
    detectChangesInternal
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:243:35
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:348:48
    detectContentChildrenChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:261:32
    detectChangesInternal@file:///app/tns_modules/@angular/core/src/linker/view.js:253:42
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:243:35
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:348:48
    detectViewChildrenChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:269:32
    detectChangesInternal@file:///app/tns_modules/@angular/core/src/linker/view.js:254:39
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:243:35
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view.js:348:48
    detectChanges@file:///app/tns_modules/@angular/core/src/linker/view_ref.js:131:78
    forEach@[native code]
    tick@file:///app/tns_modules/@angular/core/src/application_ref.js:435:45
    file:///app/tns_modules/@angular/core/src/application_ref.js:339:129
    invoke@file:///app/tns_modules/zone.js/dist/zone-node.js:281:34
    onInvoke@file:///app/tns_modules/@angular/core/src/zone/ng_zone_impl.js:53:47
    invoke@file:///app/tns_modules/zone.js/dist/zone-node.js:280:43
    run@file:///app/tns_modules/zone.js/dist/zone-node.js:174:50
    file:///app/tns_modules/@angular/core/src/application_ref.js:339:104
    file:///app/tns_modules/@angular/core/src/facade/async.js:139:74
    __tryOrUnsub@file:///app/tns_modules/rxjs/Subscriber.js:225:20
    next@file:///app/tns_modules/rxjs/Subscriber.js:174:34
    _next@file:///app/tns_modules/rxjs/Subscriber.js:124:30
    next@file:///app/tns_modules/rxjs/Subscriber.js:88:23
    _finalNext@file:///app/tns_modules/rxjs/Subject.js:128:34
    _next@file:///app/tns_modules/rxjs/Subject.js:120:28
    next@file:///app/tns_modules/rxjs/Subject.js:77:19
    emit@file:///app/tns_modules/@angular/core/src/facade/async.js:127:80
    _checkStable@file:///app/tns_modules/@angular/core/src/zone/ng_zone.js:145:48
    onLeave@file:///app/tns_modules/@angular/core/src/zone/ng_zone.js:117:35
    onInvoke@file:///app/tns_modules/@angular/core/src/zone/ng_zone_impl.js:56:38
    invoke@file:///app/tns_modules/zone.js/dist/zone-node.js:280:43
    runGuarded@file:///app/tns_modules/zone.js/dist/zone-node.js:188:54
    file:///app/tns_modules/zone.js/dist/zone-node.js:164:40
    tick@file:///app/tns_modules/timer/timer.js:17:26
    UIApplicationMain@[native code]
    start@file:///app/tns_modules/application/application.js:233:26
    file:///app/tns_modules/nativescript-angular/application.js:153:26
    ZoneAwarePromise@file:///app/tns_modules/zone.js/dist/zone-node.js:542:38
    nativeScriptBootstrap@file:///app/tns_modules/nativescript-angular/application.js:151:23
    anonymous@file:///app/main.js:7:36
    evaluate@[native code]
    moduleEvaluation@[native code]
    [native code]
    promiseReactionJob@[native code]
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 1   0x4110b0 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 2   0xabe6f8 ffi_closure_inner
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 3   0xabf022 ffi_closure_i386
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 4   0x375e136 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 5   0x375db32 __CFRunLoopDoTimer
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 6   0x371c39a __CFRunLoopRun
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 7   0x371b846 CFRunLoopRunSpecific
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 8   0x371b65b CFRunLoopRunInMode
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 9   0x548c664 GSEventRunModal
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 10  0x548c4a1 GSEventRun
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 11  0x14baeb9 UIApplicationMain
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: 12  0xabeee8 ffi_call_i386
Jul 13 18:50:03 MacBook-Pro-Yevgen ConcertUaApp[4809]: file:///app/tns_modules/rxjs/Subscriber.js:229:22: JS ERROR Error: not implemented
Jul 13 18:50:03 MacBook-Pro-Yevgen com.apple.CoreSimulator.SimDevice.091B8F9E-0AA8-40C3-B626-DD09B79D6FF0.launchd_sim[339] (UIKitApplication:org.nativescript.ConcertUaApp[0xbfa5][4809]): Service exited due to signal: Segmentation fault: 11
Jul 13 18:50:03 MacBook-Pro-Yevgen SpringBoard[356]: BSXPCMessage received error for message: Connection invalid
Jul 13 18:50:03 MacBook-Pro-Yevgen SpringBoard[356]: HW kbd: Failed to set (null) as keyboard focus
Jul 13 18:50:03 MacBook-Pro-Yevgen assertiond[360]: assertion failed: 15F34 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1

To me it looks like the xhr_backend.js module it trying to call getCookie() on an getDom() which is null.

What am I doing wrong?

Copied from original issue: NativeScript/NativeScript#2452

@vakrilov
Copy link
Contributor

I believe this is the same as #305.
Long story short:

  • If you are using 0.2.0(current latest) - you should provide the HTTP_PROVIDERS in the app bootstrap function. If you do it directly in the component providers array - you get the error.
  • In vNext you will just have to provide NS_HTTP_PROVIDERS - no matter where.

@chiefmc
Copy link

chiefmc commented Jul 15, 2016

You're right – it's the same issue.

Thanks, for pointing that out. Resolved.

@jtemerson
Copy link

So what is the implementation of this? I am new to AngularJS and Nativescript. Where is the Bootstrap function and how do provide HTTP_PROVIDERS in the function?

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