bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.25k stars 197 forks source link

Cannot set property 'map' of undefined #132

Closed duongkhoangiam closed 4 years ago

duongkhoangiam commented 4 years ago

I am using lastest expo and react native got this error !

bramus commented 4 years ago

Thanks for reporting. Duplicate of #130 and #131 . I'll track this further in #131.

bramus commented 4 years ago

Version 1.7.5 with a fix for this got released. Thanks for the input.

duongkhoangiam commented 4 years ago

Thanks you for fast update , after update Cannot set property 'map' of undefined is solved but i got new problem Unhandled promise rejection, [TypeError: Cannot read property 'distance' of undefined]

bramus commented 4 years ago

This is a new, separate, problem. I've tracked it down to using a wrong/wrongly configured API Key, or when a route request does not succeed for some reason.

You should see another error triggered just before the TypeError: Cannot read property 'distance' of undefined error, describing what went wrong. Either way: I've pushed a change to master which improves error handling, so that only that the code stops after the first error. Could you try that version out?

You can test this version in master by referring to the repository directly instead of going through the npm registry. See https://www.bram.us/2019/12/09/use-a-github-repository-as-a-dependency-in-package-json/ for instructions.

duongkhoangiam commented 4 years ago

You are correct , the problem because my API key is not allow Now good working. Good jobs bro. and many Thanks !

duongkhoangiam commented 4 years ago

I think you need error triggered when fetch response with error API key now allow is good Thanks you