diff --git a/src/plugins/regions.ts b/src/plugins/regions.ts index 21e8e9926..bd8c58adb 100644 --- a/src/plugins/regions.ts +++ b/src/plugins/regions.ts @@ -509,8 +509,8 @@ class RegionsPlugin extends BasePlugin): () => void { - const wrapper = this.wavesurfer?.getWrapper()?.querySelector('div') - if (!wrapper) return () => undefined + const wrapper = this.wavesurfer?.getWrapper()?.querySelector('div.canvases') + if (!wrapper || !(wrapper instanceof HTMLElement)) return () => undefined const initialSize = 5 let region: Region | null = null diff --git a/src/plugins/timeline.ts b/src/plugins/timeline.ts index 858671cb4..b4d54b752 100644 --- a/src/plugins/timeline.ts +++ b/src/plugins/timeline.ts @@ -103,6 +103,7 @@ class TimelinePlugin extends BasePlugin