Closed w00kie closed 6 months ago
After much research, this seems to be an issue with Axios being a CommonJS library and the way that the default create-react-app
framework is setup does not work with it.
Since the React docs do not recommend using create-react-app
anymore, I've switched to Vite and everything works like a charm out of the box.
So I guess this can be closed and I would recommend anyone struggling with create-react-app
to move to a more recent framework like Vite or Next.
I've been following the docs to use with React Query but get the following error and I don't know what to do:
My
api.ts
is as follows:And I'm calling the API in a custom element as so: