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

TypeError: Cannot read property 'extend' of undefined #1505

Closed
jscti opened this issue Sep 24, 2018 · 4 comments · Fixed by #1506
Closed

TypeError: Cannot read property 'extend' of undefined #1505

jscti opened this issue Sep 24, 2018 · 4 comments · Fixed by #1506

Comments

@jscti
Copy link

jscti commented Sep 24, 2018

Issue description
JS Error with the new version beta4 (worked fine on beta3) 👍

TypeError: Cannot read property 'extend' of undefined
at AgmMap.push../node_modules/@agm/core/directives/map.js.AgmMap._isLatLngBoundsLiteral (map.js:352)
at AgmMap.push../node_modules/@agm/core/directives/map.js.AgmMap._updateBounds (map.js:337)
at AgmMap.push../node_modules/@agm/core/directives/map.js.AgmMap._fitBounds (map.js:329)
at AgmMap.push../node_modules/@agm/core/directives/map.js.AgmMap._updatePosition (map.js:298)
at AgmMap.push../node_modules/@agm/core/directives/map.js.AgmMap.ngOnChanges (map.js:250)
at checkAndUpdateDirectiveInline (core.js:9239)
at checkAndUpdateNodeInline (core.js:10507)
at checkAndUpdateNode (core.js:10469)
at debugCheckAndUpdateNode (core.js:11102)
at debugCheckDirectivesFn (core.js:11062)

My page is quite complex so I can't give you a simple repro test case right now, but maybe there is no need as the bug seems to be the function _isLatLngBoundsLiteral that seems optimistic by not testing undefined/null prior to use it.

@Smiter15
Copy link

Duplicate of #1504

@jscti
Copy link
Author

jscti commented Sep 24, 2018

Ok,

I had a [fitBounds]="latLngBounds" which was now not-working because of the new breaking change API of
#1389

@sebholstein
Copy link
Owner

@jscti thanks for the report. The type guard is wrong here, it has to check if the value is undefined/null before checking the method. I will provide a fix for it asap

@sebholstein
Copy link
Owner

beta 5 is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants