-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in production: "Uncaught TypeError: i.fetchBaseQuery is not a function" #3533
Comments
Presumably, yeah, which is really bizarre. Never seen anyone report a problem like that before. |
I see the issue has been filed at Parcel as well: parcel-bundler/parcel#7622 (comment) |
OK, it seems these previous comments tracked down the solution. In case anyone else has stumbled across this same error, the issue is that Parcel is somehow skipping aliased exports in RTK Query. The solution is to write the import from two separate packages instead, like this: import { createApi } from '@reduxjs/toolkit/query/react'
import { fetchBaseQuery } from '@reduxjs/toolkit/query' @markerikson Thanks for chiming in so quickly. I'll let you decide what to do with the issue, but my situation is resolved. |
Wow, that's screwy :( Thanks for the heads-up! |
I have a very basic implementation of RTK Query that follows the "Basic Usage" instructions exactly:
It works exactly as expected in development, but when I deployed to a production instance, the app crashes, with this error in the console:
Am I to gather from this error message that RTK Query didn't bundle properly? I am using Parcel.
The text was updated successfully, but these errors were encountered: