T cannot be found in Js


#1

Hello, I’m kinda new in Reason, I’m trying to use bs-axios, creating an instance with it, Im trying to set the ~params labeled parameter, it request me a Js.t('a) type but writing a Js.t object it gives me the next message: t cannot be found in Js.

I hope you’re having a good day!


#2

You can create objects in a couple of different ways, one of the simplest is using the syntax sugar: https://bucklescript.github.io/docs/en/object-2#literal


#3

Hey @notpineapple, I hope you figured it out. This is how an bs-axios instance looks like in one of my projects:

let instance =
  Axios.Instance.create(
    Axios.makeConfig(
      ~baseURL="/api",
      ~headers={"Authorization": "Bearer " ++ accessToken},
      (),
    ),
  );

If you are still not able to get it to work, can you share the object you wrote?