Skip to content

saved.shift is not a function #4350

Closed
Closed

Description

@dsandber

My app auto-upgraded to 3.4.0 from 3.3.1 and broke with this error:

saved.shift is not a function

I'll append the browser version in a comment shortly.

Activity

  1. dsandber commented on Apr 11, 2019

    @dsandber
    Author

    user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"

    trace: "TypeError: saved.shift is not a function
    at HTMLDivElement.handler (...)
    at HTMLDivElement.dispatch (...)
    at HTMLDivElement.elemData.handle (...)

  2. timmywil commented on Apr 11, 2019

    @timmywil
    Member

    Sorry, there is not enough information to go on here. You can find help on https://stackoverflow.com. If after sorting out the issue you find there is a change needed in jQuery core, please open a new issue and follow the instructions in the issue template, including providing a test case from https://jsbin.com.

  3. dsandber commented on Apr 11, 2019

    @dsandber
    Author

    Sorry, because it wasn't triggered directly by my code, and because it doesn't seem to happen consistently, I don't know how to create a test case.

  4. timmywil commented on Apr 11, 2019

    @timmywil
    Member

    Fair enough, but the issue needs to be fleshed out more regardless.

  5. dsandber commented on Apr 11, 2019

    @dsandber
    Author

    Luckily "saved.shift" only occurs once in the source-code. Strange that the comment says IE <= 9 - 11+ but that it is being run on Chrome.

    dataPriv.set( this, type, jQuery.event.trigger(
      // Support: IE <=9 - 11+
      // Extend with the prototype to reset the above stopImmediatePropagation()
      jQuery.extend( saved.shift(), jQuery.Event.prototype ),
      saved,
      this
    ) );
    

    Seems to happen because saved is not an array, example:

    > let saved = ''
    > saved.shift()
    VM116:1 Uncaught TypeError: saved.shift is not a function
    
  6. mgol commented on Apr 12, 2019

    @mgol
    Member

    @dsandber Unfortunately, we cannot do much without a test case we can run, the error itself doesn't say much. We usually require a small test case without external dependencies as most errors user have is actually a bug on their app part but since this code is new in 3.4.0 & it's one of the most trickiest new part, it's possible we broke something so I'd be open to looking at a slightly bigger test case. But I still need at least a website with this bug, with an easy way to reproduce it myself. Ideally I'd have both one with jQuery 3.3.1 & 3.4.0 to compare but I could try with just 3.4.0 as well if the older one is not available.

  7. dsandber commented on Apr 12, 2019

    @dsandber
    Author

    Yeah, I understand -- probably best to wait until more people report this error and hopefully someone can develop a simple test case. I literally wouldn't know where to start since the stack trace doesn't include my code, the error doesn't happen consistently, and I don't understand what the code I quoted does.

  8. fancyapps commented on Apr 12, 2019

    @fancyapps

    I noticed this error message after upgrading to 3.4.0., too. I could not figure out when/why, I`ll try to create a minimal example.

  9. XhmikosR commented on Apr 13, 2019

    @XhmikosR

    @mgol we hit this in Bootstrap 4.x https://travis-ci.org/twbs/bootstrap/jobs/519620443

    Going back to 3.3.1 our tests pass.

  10. dsandber commented on Apr 13, 2019

    @dsandber
    Author

    Given three independent reports, perhaps the bug should be re-opened to make it easier for others to find? (since closed bugs aren't searched by default)

  11. dmethvin commented on Apr 13, 2019

    @dmethvin
    Member

    Reopening it is fine, but we still don't have a test case. Can we at least get a stack trace?

  12. XhmikosR commented on Apr 13, 2019

    @XhmikosR

    The stacktrace is shown in the Travis build, but it's using the minified build. AFAICT it only affects IE 10/11, at least in our test suite.

  13. dsandber commented on Apr 13, 2019

    @dsandber
    Author

    Can we at least get a stack trace?

    My second comment includes a stack trace.

    AFAICT it only affects IE 10,

    Chrome too.

  14. 16 remaining items

  15. ewolfman commented on Apr 17, 2019

    @ewolfman

    Hi,
    When is the 3.4.1 release date?

  16. timmywil commented on Apr 17, 2019

    @timmywil
    Member

    There's no set date, but it will probably be next week or the week after.

  17. dmnd commented on Apr 25, 2019

    @dmnd

    I just broke production because of this bug.

    GitHub currently pushes recommendations to all repos using jquery <3.4.0 to upgrade due to CVE-2019-5428. I saw that, so I checked out the release blog post which currently says:

    There should be no compatibility issues if upgrading from jQuery 3.0+.

    So after some brief sanity testing (which seemed fine) I deployed and then errors started arriving.

    Given this bug, I recommend you change the wording on the blog post for 3.4.0.

  18. added a commit that references this issue on Apr 29, 2019
    24d71ac
  19. mgol commented on Apr 29, 2019

    @mgol
    Member

    Fixed by PR #4354 (commit 24d71ac).

  20. vincentwoo commented on May 1, 2019

    @vincentwoo

    Any word on when a 3.4.1 release will be cut?

  21. jcubic commented on May 1, 2019

    @jcubic

    @vincentwoo I'm also interested when it will be out, It seems that only iOS 10 test are waiting https://github.com/jquery/jquery/milestone/20

  22. timmywil commented on May 1, 2019

    @timmywil
    Member
  23. locked as resolved and limited conversation to collaborators on Oct 28, 2019
  24. added a commit that references this issue on Feb 2, 2024
    ddfa837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions