migration from angular 5 to angular 7










3















Yesterday i have migrated my application from Angular 5 to angular 7. In that process i have changed EventSource to EventSourcePolyfill as suggested while running the application. But since then i am facing a strange issue. This is what i am getting the issue in console as follows:



ERROR TypeError: Cannot read property 'heartbeatTimeout' of undefined
at new EventSourcePolyfill (eventsource.js:155)
at AppFooterComponent.push../src/app/layout/footer/footer.component.ts.AppFooterComponent.connect (footer.component.ts:133)
at SafeSubscriber._next (footer.component.ts:52)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at AsyncAction.dispatch (timer.js:31)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction._execute (AsyncAction.js:63)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction.execute (AsyncAction.js:51)


This is what i did in my code:



import EventSourcePolyfill from 'ng-event-source';

let source = new EventSourcePolyfill('/api/v1/events/register');


Can any one suggest me how to get rid of this issue.



Thanks.










share|improve this question
























  • The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

    – inthevortex
    Nov 15 '18 at 5:30












  • When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

    – youi
    Nov 15 '18 at 5:38











  • Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

    – Walter Łuszczyk
    Nov 22 '18 at 6:59
















3















Yesterday i have migrated my application from Angular 5 to angular 7. In that process i have changed EventSource to EventSourcePolyfill as suggested while running the application. But since then i am facing a strange issue. This is what i am getting the issue in console as follows:



ERROR TypeError: Cannot read property 'heartbeatTimeout' of undefined
at new EventSourcePolyfill (eventsource.js:155)
at AppFooterComponent.push../src/app/layout/footer/footer.component.ts.AppFooterComponent.connect (footer.component.ts:133)
at SafeSubscriber._next (footer.component.ts:52)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at AsyncAction.dispatch (timer.js:31)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction._execute (AsyncAction.js:63)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction.execute (AsyncAction.js:51)


This is what i did in my code:



import EventSourcePolyfill from 'ng-event-source';

let source = new EventSourcePolyfill('/api/v1/events/register');


Can any one suggest me how to get rid of this issue.



Thanks.










share|improve this question
























  • The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

    – inthevortex
    Nov 15 '18 at 5:30












  • When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

    – youi
    Nov 15 '18 at 5:38











  • Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

    – Walter Łuszczyk
    Nov 22 '18 at 6:59














3












3








3








Yesterday i have migrated my application from Angular 5 to angular 7. In that process i have changed EventSource to EventSourcePolyfill as suggested while running the application. But since then i am facing a strange issue. This is what i am getting the issue in console as follows:



ERROR TypeError: Cannot read property 'heartbeatTimeout' of undefined
at new EventSourcePolyfill (eventsource.js:155)
at AppFooterComponent.push../src/app/layout/footer/footer.component.ts.AppFooterComponent.connect (footer.component.ts:133)
at SafeSubscriber._next (footer.component.ts:52)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at AsyncAction.dispatch (timer.js:31)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction._execute (AsyncAction.js:63)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction.execute (AsyncAction.js:51)


This is what i did in my code:



import EventSourcePolyfill from 'ng-event-source';

let source = new EventSourcePolyfill('/api/v1/events/register');


Can any one suggest me how to get rid of this issue.



Thanks.










share|improve this question
















Yesterday i have migrated my application from Angular 5 to angular 7. In that process i have changed EventSource to EventSourcePolyfill as suggested while running the application. But since then i am facing a strange issue. This is what i am getting the issue in console as follows:



ERROR TypeError: Cannot read property 'heartbeatTimeout' of undefined
at new EventSourcePolyfill (eventsource.js:155)
at AppFooterComponent.push../src/app/layout/footer/footer.component.ts.AppFooterComponent.connect (footer.component.ts:133)
at SafeSubscriber._next (footer.component.ts:52)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at AsyncAction.dispatch (timer.js:31)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction._execute (AsyncAction.js:63)
at AsyncAction.push../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.AsyncAction.execute (AsyncAction.js:51)


This is what i did in my code:



import EventSourcePolyfill from 'ng-event-source';

let source = new EventSourcePolyfill('/api/v1/events/register');


Can any one suggest me how to get rid of this issue.



Thanks.







node.js angular typescript migration eventsource






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 6:24









Goncalo Peres

1,4771720




1,4771720










asked Nov 15 '18 at 4:48









youiyoui

344315




344315












  • The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

    – inthevortex
    Nov 15 '18 at 5:30












  • When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

    – youi
    Nov 15 '18 at 5:38











  • Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

    – Walter Łuszczyk
    Nov 22 '18 at 6:59


















  • The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

    – inthevortex
    Nov 15 '18 at 5:30












  • When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

    – youi
    Nov 15 '18 at 5:38











  • Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

    – Walter Łuszczyk
    Nov 22 '18 at 6:59

















The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

– inthevortex
Nov 15 '18 at 5:30






The origin of the error is in footer.component.ts(line 133), kindly check it there. heartbeatTimeout might not be in the properties of the object you are trying to read.

– inthevortex
Nov 15 '18 at 5:30














When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

– youi
Nov 15 '18 at 5:38





When i comment it out then it works properly. I mean the EventSourcePolyfill is commented the it works fine. Its not the issue with the footer.component.ts. The code in footer.component.ts of EventSourcePoyfill breaks. Please suggest.

– youi
Nov 15 '18 at 5:38













Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

– Walter Łuszczyk
Nov 22 '18 at 6:59






Have you used ng update command for migration? It has ability to refactor some breaking changes? Have you followed instructions on update.angular.io? There are some steps with RxJS migration.

– Walter Łuszczyk
Nov 22 '18 at 6:59













1 Answer
1






active

oldest

votes


















1














You have to pass additional parameters, as



eventSource = new EventSourcePolyfill(url,
heartbeatTimeout: 5000, connectionTimeout: 5000, headers: 'Authorization': 'Basic foo' );





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312582%2fmigration-from-angular-5-to-angular-7%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You have to pass additional parameters, as



    eventSource = new EventSourcePolyfill(url,
    heartbeatTimeout: 5000, connectionTimeout: 5000, headers: 'Authorization': 'Basic foo' );





    share|improve this answer



























      1














      You have to pass additional parameters, as



      eventSource = new EventSourcePolyfill(url,
      heartbeatTimeout: 5000, connectionTimeout: 5000, headers: 'Authorization': 'Basic foo' );





      share|improve this answer

























        1












        1








        1







        You have to pass additional parameters, as



        eventSource = new EventSourcePolyfill(url,
        heartbeatTimeout: 5000, connectionTimeout: 5000, headers: 'Authorization': 'Basic foo' );





        share|improve this answer













        You have to pass additional parameters, as



        eventSource = new EventSourcePolyfill(url,
        heartbeatTimeout: 5000, connectionTimeout: 5000, headers: 'Authorization': 'Basic foo' );






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 24 '18 at 21:32









        jayjay

        1555




        1555





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53312582%2fmigration-from-angular-5-to-angular-7%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Darth Vader #20

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Ondo