useQuery results in having this error: TypeError: url__WEBPACK_IMPORTED_MODULE_0__.URLSearchParams
This is my first time using react query, and I seem to be running into some difficulties, some help would be appreciated.
I have an api endpoint that when I call manually, results in valid data being returned: (see screenshot 1)
The code for this in short is:
When I try convert this into a query, as so:
hook:
browser throw error of
What am I doing wrong? I am using Next js.
I will also mention that, when I change the api code to return a simple array:
Then, the query returns the array as expected.
I have an api endpoint that when I call manually, results in valid data being returned: (see screenshot 1)
The code for this in short is:
When I try convert this into a query, as so:
hook:
browser throw error of
TypeError: url__WEBPACK_IMPORTED_MODULE_0__.URLSearchParams is not a constructorWhat am I doing wrong? I am using Next js.
I will also mention that, when I change the api code to return a simple array:
Then, the query returns the array as expected.
