JS SDK - I can't execute from other route than index.html

JS SDK - I can't execute from other route than index.html

I am working with a React widget.

When I try to use AddRecord from the JS SDK APIs from /index.html of my react app the request is successful.

While when I try to use the same function from the same promise (initialised in App.js) but from different route, I get the following error:


On the photo above you can see first the request sent from the default page /index.html, while the second one is after a route change.

How can I achieve to be able to use the APIs from different routes