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

undefined is not an object (evaluating 'this._data[this._data.length-1].push') #329

Closed
lathonez opened this issue Jan 3, 2018 · 18 comments

Comments

@lathonez
Copy link

lathonez commented Jan 3, 2018

Hey,

I'm just raising this for your visibility / in case you have any ideas. I don't have a repro and am not expecting you to be able to do anything to solve this.

We're getting this error thrown on one of our production apps. We have lots of apps running out there and only one has ever had this issue, which suggests to me it might be device related.

The error

undefined is not an object (evaluating 'this._data[this._data.length-1].push')

Is being thrown from here:

https://github.com/szimek/signature_pad/blob/master/src/signature_pad.js#L173-L178

That's pretty much all the info I have. The client using the app hasn't reported anything to us from a behaviour perspective.

Other info:

  • Ionic 3 / Angular 4 app deployed via the AppStore
  • iPad Model: iPad6,11
  • UA: UA: Mozilla/5.0 (iPad; CPU OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Mobile/15A402

I am tracking the issue and will update you if I get further information.

Thanks for all your hard work on this repo,

Stephen

@lathonez
Copy link
Author

Just seen again on another instance of the app:

  • iOS 11.2.5
  • iPad6,11

@stefankunze
Copy link

stefankunze commented Feb 15, 2018

I also can see that Issue on Chrome Mobile v.56.0.2924/64.0.3282 on Android v.7.0
Seems to be within the _strokeUpdate function

@timbru31
Copy link

I'm joining the club with the error messages:
TypeError: Cannot read property 'push' of undefined and TypeError: Cannot read property 'length' of undefined

Our tracking said it's a Samsung SM-T5851 with Chrome 64.0.01 and running Android 7.0.01


Minified stack trace:

Cannot read property 'push' of undefined
at i._strokeUpdate (scripts.09258a303eed71dcb9ac.bundle.js:1)
at i._strokeMoveUpdate (scripts.09258a303eed71dcb9ac.bundle.js:1)
at HTMLCanvasElement._handleTouchMove (scripts.09258a303eed71dcb9ac.bundle.js:1)
at e.invokeTask (polyfills.395920b077ebea14c462.bundle.js:1)
at Object.onInvokeTask (main.4f4970c93c661f275c5d.bundle.js:1)
at e.invokeTask (polyfills.395920b077ebea14c462.bundle.js:1)
at t.runTask (polyfills.395920b077ebea14c462.bundle.js:1)
at t.invokeTask [as invoke] (polyfills.395920b077ebea14c462.bundle.js:1)
at _ (polyfills.395920b077ebea14c462.bundle.js:1)
at HTMLCanvasElement.m (polyfills.395920b077ebea14c462.bundle.js:1)

@bbialas
Copy link

bbialas commented Jul 14, 2018

+1

1 similar comment
@sp53519
Copy link

sp53519 commented Jul 18, 2018

+1

@rafaelgrilli92
Copy link

rafaelgrilli92 commented Oct 24, 2018

Same issue:
Message | undefined is not an object (evaluating 'this._data[this._data.length-1].push')
Failed method | _strokeUpdate |  
Device model | iPhone |  
Operating system | iOS 12.0 |  
Browser version | Mobile Safari 12.0

Also this straight after the error above:
Message | undefined is not an object (evaluating 'a.length') |
Failed method | _strokeEnd |  
Device model | iPhone |  
Operating system | iOS 12.0 |  
Browser version | Mobile Safari 12.0

And the issue has been open since January and got no answers =/

@jmeinke
Copy link

jmeinke commented Jan 22, 2019

Maybe the TypeScript rewrite (-> version 3) from @szimek will remove this error. We also have got a report about it via Sentry for Mobile Safari 12.0 on iPad with iOS 12.1.1. We are currently using Signature Pad version 2.3.2.

@busiweb
Copy link

busiweb commented Feb 5, 2019

I think I've found the solution: Add the following line inside the o.prototype.clear function (above everything else):
this._data = [];

@rafaelgrilli92
Copy link

@busiweb did it work? If so, do a pull request with the fix, plz

@dphrag
Copy link

dphrag commented Apr 13, 2019

Saw this reported on a Safari 12.1 / iOS 12.2 device :(

@JosNun
Copy link

JosNun commented Jun 3, 2019

Also experiencing this issue. iPad with iOS 12.2

@lewisloofis
Copy link

lewisloofis commented Oct 14, 2019

Also experiencing this issue, Samsung SM-J730G with Android 7.0. Any update on this?

@webfletch
Copy link

Also experiencing this issue on iPhone 11 Pro with iOS 13.4.1. It doesn't seem to cause a problem for the end-user but now that my App has error logging it is rather annoying receiving alerts about this.

@UziTech UziTech closed this as completed Jun 19, 2021
@JosNun
Copy link

JosNun commented Jun 19, 2021

@UziTech As far as I'm aware, this issue hasn't been resolved. I'm assuming it's been closed to clean up issues that are stale?

@UziTech
Copy link
Collaborator

UziTech commented Jun 19, 2021

If this is still an issue you can open another issue with more information. As far as I know this issue has been resolved in the latest beta release.

@JosNun
Copy link

JosNun commented Jun 21, 2021

Ah, my bad. I looked at the tags and didn't see a beta 4 tag. I didn't realize that beta 4 had only been pushed to NPM.

@capc0
Copy link

capc0 commented Aug 10, 2021

can someone confirm that the issue is fixed?

the changelog https://github.com/szimek/signature_pad/blob/master/CHANGELOG.md#300-beta4 only references another issue #480 instead of this one.

@agilgur5
Copy link
Contributor

agilgur5 commented Feb 6, 2022

Looking at #481, I believe it should have fixed this as well. The early return for the race condition there is in the same method as this issue. So, if I understand correctly, if this._data.length === 0 this line won't be hit either and so this error shouldn't occur.

That is of course only if the root cause for this error is the same race condition (that causes this to evaluate to a buggy this.data[-1].push)

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