#1315·webamp

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

Author: jMylesCreated Sep 13, 2025Updated Sep 16, 2025

I have what I think is a very straightforward invocation:

javascript
        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.