chrisdrackett / react-mapkit

React wrapper for Apple's mapkit.js.
https://chrisdrackett.github.io/react-mapkit/?selectedStory=all%20props&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybooks%2Fstorybook-addon-knobs
MIT License
76 stars 26 forks source link

TypeError: this.fn is undefined #47

Open pdugan20 opened 4 years ago

pdugan20 commented 4 years ago

I'm using this with a next.js implementation, and I've found that if I leave the website open in a window for a few minutes, and then try and load a page with a mapkit component, that the map itself will load, but the background images (the actual streets and landscapes) never actually render.

Here's the stack-trace: https://sentry.io/share/issue/d2bc177c4a9b4136a290012cc02de9a9/

I'd be happy to share any code samples if that's helpful here.

pdugan20 commented 4 years ago

The console spits out: [MapKit] CSR is unavailable: 5

...when this happens. Assuming CSR is "Client Side Render" in this instance?

mikaalnaik commented 3 years ago

Hey @pdugan20,

Did you ever manage to find a solution to this? I'm digging into the same problem and will follow up if I find one

pdugan20 commented 3 years ago

@mikaalnaik I haven't given it a lot of thought. Since it seems like it's a timeout, a pretty poor solution would be to set the page the map is displayed upon to automatically refresh after X minutes.

chrisdrackett commented 2 years ago

I'm not sure what this might be. Can you create a breaking test case? I'm guessing this has something to do with the way we load the mapkit javascript from apple. I feel like there must be a better way to do this. I might just need to take out our code for this and require users to add a script tag to their site.