#No QueryClient set
8 messages · Page 1 of 1 (latest)
npm install medusa-react@latest
I had the same issue with a fresh starter install today. starting from medusa-react 4.0.4, you need to remove the workaround in next.config.js (see https://github.com/medusajs/medusa/issues/3214)
I still have this issue even though i ran npm install medusa-react@latest
I already have "medusa-react": "^4.0.4"
And my files are already using @tanstack/react-query instead of react-query. This is why I don't understand what's wrong
Have you removed the workaround from next.config, as @royal apex said?
@fallen kernel I didn't use the workaround, i just cloned a fresh install and it already has this "workaround" bundled
Ok I fixed it by commenting the workaround. my next.config.js looks like this now :
const { withStoreConfig } = require("./store-config")
const store = require("./store.config.json")
const path = require("path")
module.exports = withStoreConfig({
features: store.features,
reactStrictMode: true,
images: {
domains: ["medusa-public-images.s3.eu-west-1.amazonaws.com", "localhost"],
},
// webpack: (config, options) => {
// if (options.isServer) {
// config.externals = ["@tanstack/react-query", ...config.externals]
// }
// const reactQuery = path.resolve(require.resolve("@tanstack/react-query"))
// config.resolve.alias["@tanstack/react-query"] = reactQuery
// return config
// },
})
console.log("next.config.js", JSON.stringify(module.exports, null, 2))