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.