Closed geigerzaehler closed 5 months ago
We're experiencing the same issue from the same version and have put through a support request to contentful
Hi @geigerzaehler thanks for reporting. A stack trace of the The query you sent included duplicate URI query parameters
error would be helpful in diagnosing where this problem is occurring. I have not been able to reproduce yet with the same setup you're describing.
Thanks for taking a look @t-col. Here’s the stack trace:
BadRequest
at Ur (http://localhost:3000/node_modules/.vite/deps/contentful.js?v=9eaebbc3:6774:22)
at a2 (http://localhost:3000/node_modules/.vite/deps/contentful.js?v=9eaebbc3:7217:17)
at async u2 (http://localhost:3000/node_modules/.vite/deps/contentful.js?v=9eaebbc3:7224:27)
[REDACTED]
It looks like the package does not provide any sourcemaps so this doesn’t look helpful unfortunately.
Can I make the steps to reproduce the issue clearer in any way? Which part can’t you reproduce?
If it helps, I was able to reproduce this with some simple steps:
It's a supplemental step to then go back online in Dev tools and see that the next request when internet is available will return with 400 error from server because it has incorrect query params. The issue isn't so much to do with the error itself, but rather whatever is retrying the request is doing so incorrectly.
@geigerzaehler in the interest of thoroughness - are you passing in any custom configuration to the underlying axios instance from within the wrapping vite application? i.e.
const client = createClient({
space: '<your_space>',
accessToken: '<your_token>',
// ... other configuration
})
are you passing in any custom configuration to the underlying axios instance from within the wrapping vite application?
No, I’m only passing space and access token to createClient
.
repro video
https://github.com/contentful/contentful.js/assets/1049837/e1ac7ac8-6b6a-475d-9fcf-0ea3b1e41d16
here's the 400 response if you need it. It's BadRequest due to the duplicated query params.
When a request is retried query parameters are duplicated which results in a 400 response.
This is a bit tricky to reproduce, but possible with Chrome Dev Tools’ network request blocking feature. I have a simple script that I load in the browser:
In the dev tools I add “contentful“ to the list of blocked requests.
Then I reload the page. In the network tab of the dev tools I can see that requests to contentful are blocked. I quickly uncheck contentful in the request blocking tab to let it go through. But the server responds with a 400 and the message “The query you sent included duplicate URI query parameters...”.
From the network tab I can see that the request URL looks like this:
It looks like every retry appends the query string again.
This issue started to occur in 10.11.1 and wasn’t present in 10.11.0.