How can I use a library (@rescript/webapi) in a project?

I am trying to use the @rescript/webapi library, but I can’t quite get it to work. I’ve had issues with other libraries as well.

I have a ReScript project set up and working. In order to use @rescript/webapi, I ran npm install @rescript/webapi and I added "@rescript/webapi" to the bs-dependencies part of my bsconfig.json file.

However, when I try to open Webapi.Dom, I get the error The module or file Webapi can't be found. when I build with npm run res:build && npm run build. I’ve tried cleaning first as well. I notice that node_modules does indeed have a @rescript/webapi subdirectory.

What’s causing the issue here? I suspect I’m missing something obvious, but I’m new to ReScript and I’ve never successfully used a library in a ReScript project before (it seems like I have this issue every time I’ve tried, so far).

For the larger context: the main reason I want to use webapi at the moment is so that I can use getElementById.

Hello, what version of ReScript are you using?
Because the experimental webapi is targeting the v12 alphas.
This won’t work if you use ReScript 11.

And if the v11 versus v12 is not your problem, you may want to open WebAPI.DOMAPI instead.
See DOMAPI | Experimental WebAPI

Ah, that must be at least part of the problem. I’m using version 11.1.4.