diff --git a/CHANGELOG.md b/CHANGELOG.md index b603b4dab6..477ca7b201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ### Features and improvements - Default compact attribution to be open by default to comply with OpenSteetMap Attribution Guidelines (#795) -- Export `Source` classes (`GeoJSONSource` etc.) declarations. ([#801](https://github.com/maplibre/maplibre-gl-js/issues/801)) +- Export `Source` classes (`GeoJSONSource` etc.) declarations. (#801) - Make `AJAXError` public so error HTTP responses can be handled differently from other errors. - *...Add new stuff here...* @@ -12,6 +12,7 @@ - Fix compact attribution button showing when attribution is blank (#795) - Fix error mismatched image size for CJK characters (#718) - Fire `dataabort` and `sourcedataabort` events when a tile request is aborted (#794) +- Fix NextJs `performance` undefined (#768) - *...Add new stuff here...* ## 2.1.1 diff --git a/src/util/browser.ts b/src/util/browser.ts index 8c0fdd33aa..a507d8b6b4 100755 --- a/src/util/browser.ts +++ b/src/util/browser.ts @@ -1,6 +1,6 @@ import type {Cancelable} from '../types/cancelable'; -const now = performance && performance.now ? +const now = typeof performance !== 'undefined' && performance && performance.now ? performance.now.bind(performance) : Date.now.bind(Date);