Build complains about non-existent bs-webapi

I’m trying to upgrade to rescript 10 and switched from bs-webapi to rescript-webapi to deal with that build issue. But despite updating my package.json and bsconfig, my build complains that it can’t find bs-webapi. What else could be referencing this package? The build claims the problem is my bsconfig, but there’s no reference of it in there.

❯ yarn rescript clean -with-deps                                                                                                                                                                                                                yarn run v1.22.19                                                                                                                                                                                                                              
$ ./node_modules/.bin/rescript clean -with-deps                                                                                                                                                                          
File "bsconfig.json", line 1                                                                                                                                                                                                                   
Error: package bs-webapi not found or built                                                                                                                                                                                                    
- Did you install it?                                                                                                                                                                                                                          
- If you did, did you run `rescript build -with-deps`?                                                                                                                                                                                         
error Command failed with exit code 2.                                                                                                                                                                                                         
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My bsconfig:

"bs-dependencies": [
    "@glennsl/bs-json",
    "bs-fetch",
    "rescript-react-intl",
    "rescript-webapi",
    "reason-future",
    "@rescript/react",
    "rescript-react-update",
    "@reasonml-community/graphql-ppx",
    "rescript-apollo-client",
    "re-dnd"
  ]

Do you run rescript build with the -with-deps flag?

Yes, I’ve tried build and clean -with-deps. I’ve deleted lib, node_modules, and .merlin in case somehow the reference was in one of those.

OK, tracked it down. My re-dnd has a dependency on bs-webapi (and doesn’t install it.) Is there an easier way to troubleshoot this? I went through every dependency in my bsconfig to find the one that used bs-webapi.

1 Like