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

Not able to bind to moment, getting TypeError: (value || "").split is not a function #355

Closed
cyates81 opened this issue Feb 9, 2018 · 8 comments
Labels

Comments

@cyates81
Copy link

cyates81 commented Feb 9, 2018

Hello,

I am using Angular 5, moment 2.20.1, Chrome 64, Mac High Sierra. I updated to version 2.7.4 and now I get the following stack trace:

Uncaught (in promise): TypeError: (value || "").split is not a function
TypeError: (value || "").split is not a function
at UtilsService.datesStringToStringArray (http://localhost:8100/build/vendor.js:44895:30)
at DatePickerService.isValidInputDateValue (http://localhost:8100/build/vendor.js:211582:45)
at DatePickerComponent.onViewDateChange (http://localhost:8100/build/vendor.js:92223:35)
at http://localhost:8100/build/vendor.js:129065:34
at SafeSubscriber.schedulerFn [as _next] (http://localhost:8100/build/vendor.js:4586:36)
at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/vendor.js:63973:16)
at SafeSubscriber.next (http://localhost:8100/build/vendor.js:63920:22)
at Subscriber._next (http://localhost:8100/build/vendor.js:63860:26)
at Subscriber.next (http://localhost:8100/build/vendor.js:63824:18)
at EventEmitter.Subject.next (http://localhost:8100/build/vendor.js:64060:25)

The only way I can prevent this is to bind to a string which is not ideal. Thanks for your help.

@cyates81
Copy link
Author

cyates81 commented Feb 9, 2018

For more info, I had updated from 2.3.2 up to 2.7.4 when I experienced the bug. I decided to downgrade to 2.3.2 and incrementally test each version to figure out where it stopped working and 2.5.0 is where it no longer works with the moment object. The error is slightly different, however: TypeError: value.split is not a function. For now I will just use version 2.4.0

@vlio20
Copy link
Owner

vlio20 commented Feb 9, 2018

It would be great if you could create a stackblitz with your configuration.

@cyates81
Copy link
Author

cyates81 commented Feb 9, 2018

https://ionic-8csbwc.stackblitz.io/

The error will show in console. It appears to still work somewhat on stackblitz but when running from ionic serve it brings the error window up and then doesn't function properly.

@vlio20
Copy link
Owner

vlio20 commented Feb 13, 2018

@cyates81 can u please share the link to stackblitz editor instead of the preview?

@cyates81
Copy link
Author

@vlio20
Copy link
Owner

vlio20 commented Feb 15, 2018

As a workaround I suggest to do as follows https://stackblitz.com/edit/ionic-qa1cjj

I will mark it as bug, I hope I will have the time to address this issue in the next few days.

vlio20 added a commit that referenced this issue Feb 18, 2018
vlio20 added a commit that referenced this issue Feb 19, 2018
@vlio20
Copy link
Owner

vlio20 commented Feb 21, 2018

fixed, will be available in version 2.7.5

@vlio20 vlio20 closed this as completed Feb 21, 2018
@cyates81
Copy link
Author

Much appreciated!

vlio20 added a commit that referenced this issue Mar 5, 2018
* fixing #340 (#341)

* updating change log

* fixing changelog

* testing new build (#351)

* version bump

* fixing issue #355 (#356)

* resolving conflict

* fixing 359

* Adding documentation for

* fixing changelog

* fixing build
vlio20 added a commit that referenced this issue Mar 12, 2018
* fixing #340 (#341)

* updating change log

* fixing changelog

* testing new build (#351)

* version bump

* fixing issue #355 (#356)

* resolving conflict

* fixing 359

* Adding documentation for

* fixing changelog

* fixing build

* version bump

* hideOnOutsideClick added (#363)

* removing redundant import

* closing 367

* fixing change log

* resolving moment value in Reactive forms (#372)

* updating changelog

* updating changelog
vlio20 added a commit that referenced this issue Apr 15, 2018
* fixing #340 (#341)

* updating change log

* fixing changelog

* testing new build (#351)

* version bump

* fixing issue #355 (#356)

* resolving conflict

* fixing 359

* Adding documentation for

* fixing changelog

* fixing build

* version bump

* hideOnOutsideClick added (#363)

* removing redundant import

* closing 367

* fixing change log

* resolving moment value in Reactive forms (#372)

* updating changelog

* updating changelog

* fixing merge + resolving 389

* moving to node 8

* adding documentation

* xit flappy test

* moving more test to xit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants