captbaritone / captbaritone/webamp

renderWhenReady errors with 'can't access property "getBoundingClientRect"'

Open
#1,315 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
796
PR merge metrics
No merged PRs in 30d

Description

I have what I think is a very straightforward invocation:

```js
webamp = new Webamp({
initialTracks: [{
url: "/audio/0 - Paint Exchange.flac",
}],
enableHotkeys: true,
volume: 75
});

webamp.renderWhenReady().then(() => {
console.log("rendered webamp!");
}).catch(error => {
alert(error.message)
});
```

...and unless I pass a DOM element to `renderWhenReady`, it fails with an error saying that it can't access `getBoundingClientRect`.

It seems like it's trying to access properties of the DOM element that I'm not passing.

I'm sure I'm doing something silly, and the problem is right in front of me. :-) But in the unlikely event that it's a browser or library compatibility issue, I figured I'd document it here until I figure it out.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied Webamp constructor and renderWhenReady() call, then trace how the method handles its DOM-element argument before accessing getBoundingClientRect. Confirm whether the no-argument call is supported and add a regression check for the shown invocation; done means the behavior is corrected or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.