I am using React.lazy to load some React classes on runtime so that they are not all loaded at once. My code works for production, but crashes when I am in development mode.
I was able to fix this by changing
map.on('moveend', update());
to
map.on('moveend', function () { update(); });