Next.js Discord

Discord Forum

Transpiling react-query 5 causing client-side errors in production

Unanswered
Bombay-duck posted this in #help-forum
Open in Discord
Bombay-duckOP
Hey everyone!

I seem unable to transpile react-query for wider browser compatibility. My next.config.js looks like this:
{
transpilePackages: ['@tanstack/react-query', '@tanstack/query-core'],
}

However, the build code causes an error on all browsers (even modern ones):
react-dom.production.min.js:189 TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function
    at n.setEventListener (focusManager.js:34:22)
    at n.onSubscribe (focusManager.js:23:12)
    at n.subscribe (subscribable.js:9:10)
    at X.mount (queryClient.js:36:43)
    at QueryClientProvider.js:24:12
    at Rj (react-dom.production.min.js:244:322)
    at Ik (react-dom.production.min.js:286:88)
    at Fk (react-dom.production.min.js:273:185)
    at jg (react-dom.production.min.js:127:100)
    at react-dom.production.min.js:283:470


Has anyone had luck enabling transpilation in Next.js and react-query 5?

0 Replies