Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Server crashes from evaluating functions executed after setTimeout #267

Closed

Description

@qdouble

Currently Universal will crash when parsing an unsupported function executed after setTimeOut, even though the function is not executed until after the page is fully loaded...for example...

setTimeout(() => {
            this.renderer.invokeElementMethod(this.myTag.nativeElement, 'focus', []);
 }, 100);

The above will cause "EXCEPTION: Error: not implemented". Methods called in setTimeout should either be ignored or better handled.

Activity

  1. PatrickJS commented on Feb 11, 2016

    @PatrickJS
    Contributor

    'focus' was not implemented for the server version of the DOM adaptor

  2. qdouble commented on Feb 11, 2016

    @qdouble
    Author

    @gdi2290 yes, I understand that... the issue that was brought up in slack chat is more so that the server would not be executing that function anyway since it won't execute the setTimeout block until after the page has fully downloaded, therefore the setTimeout block should be ignored or better handled.

  3. jeffwhelpley commented on Feb 23, 2016

    @jeffwhelpley
    Contributor

    @gdi2290 this is interesting because some people want the body of setTimeout to be executed on the server. I think that we should likely make a hard, clear stance on async on the server. What do you think about making sure we wait on the server for both http and some new modules we create to wrap setTimeout (i.e. universalTimeout or whatever), but then all other setTimeouts are monkey patched on the server to do nothing.

    Alternatively we can just tell people not to use setTimeout, but that may just lead to inevitable issues.

  4. PatrickJS commented on Apr 3, 2016

    @PatrickJS
    Contributor

    @qdouble we’re tracking setTimeout, setInterval (although no one should use this for SSR), and setImmediate now in zone.js with angular2-universal-polyfills 0.3.1 and our new way of checking when the app is stable via checkStable

  5. angular-automatic-lock-bot commented on Sep 4, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions