Hey, I found a bug in the fetch interceptor in sup...
# support-questions-legacy
u
Hey, I found a bug in the fetch interceptor in supertokens-website (lib/ts/recipeImplementation.ts) 172:91 When we make our fetch calls we pass a URL object into it as the typescript definitions suggests. Doing that we get the following error:
Copy code
js
TypeError: url.clone is not a function
and that makes sense as you do the following
Copy code
js
typeof url === "string" ? url : (url as Request).clone()
the
URL
object does not have the clone methed defined. We currently solve it be calling toString before passing it to fetch, but breaking the fetch api might make other thirdparty dependencies break. You can try it yourself by doing something like this:
Copy code
js
fetch(new URL(("https://localhost:3000/index.html"))).then(() => {console.log("fetched")}).catch(err => console.log("err", err))
r
hey @urbansson thanks for this. @porcellus can check this out and fix it 🙂
@urbansson would be great if you could open an issue about this on our github.
u
Sure thing, will do
p
thanks for reporting this. this is indeed a bug. I'm hoping to get the fix in a PR tonight, so I think you can expect the fix soon 🙂
15 Views