querycache issue
tsc --build && vite build
src/index.tsx(28,28): error TS2322: Type 'import("/Users/jacobferrari/wasupupdate/my-saas/app/node_modules/@tanstack/query-core/build/lib/queryClient").QueryClient' is not assignable to type 'import("/Users/jacobferrari/wasupupdate/my-saas/app/.wasp/build/web-app/node_modules/@tanstack/query-core/build/lib/queryClient").QueryClient'.
Types have separate declarations of a private property 'queryCache'.
/Users/jacobferrari/.local/share/wasp-lang/0.16.4/data/packages/deploy/node_modules/zx/build/core.cjs:416
const output = self._output = new ProcessOutput(dto);
^
ProcessOutput [Error]:
at Proxy.set (/Users/jacobferrari/.local/share/wasp-lang/0.16.4/data/packages/deploy/node_modules/zx/build/core.cjs:277:18)
exit code: 2 (Misuse of shell builtins)
at EventEmitter.end (/Users/jacobferrari/.local/share/wasp-lang/0.16.4/data/packages/deploy/node_modules/zx/build/core.cjs:416:41)
at EventEmitter.emit (node:events:536:35)
at ChildProcess.<anonymous> (/Users/jacobferrari/.local/share/wasp-lang/0.16.4/data/packages/deploy/node_modules/zx/build/vendor-core.cjs:502:16)
at Object.onceWrapper (node:events:639:26)
at ChildProcess.emit (node:events:524:28)
at maybeClose (node:internal/child_process:1101:16)
at Socket.<anonymous> (node:internal/child_process:456:11)
at Socket.emit (node:events:524:28)
at Pipe.<anonymous> (node:net:350:12)
at Pipe.callbackTrampoline (node:internal/async_hooks:130:17) {
_code: [Getter],
_signal: [Getter],
_stdout: [Getter],
_stderr: [Getter],
_combined: [Getter],
_duration: [Getter]
}
Node.js v22.12.0
Only getting this when deploying
4 Replies
Hi @Zuck. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error you're encountering:
is a classic TypeScript issue that happens when two different copies of the same package (here,
- Delete all
- Run
- Make sure there are no other
- Ensure you are using a Node.js version compatible with your Wasp version. Sometimes, mismatched Node versions can cause unexpected issues [Node version conflict]. If you continue to have issues, please provide more details about your project structure and any customizations to your build process. The knowledge sources do not mention a direct fix for this specific
@tanstack/query-core
) are present in your project. TypeScript treats types from different package instances as incompatible, even if they are the same version, because their private properties are not shared.
This often happens in monorepos or when your build process causes multiple node_modules
folders to exist at different levels (e.g., one in your project root and another in .wasp/build/web-app/node_modules
). Wasp's SDK and build process can sometimes lead to this situation, especially if there are node_modules
or package.json
files higher up in your directory tree, or if you are running Wasp inside another npm project. This is a known issue in Wasp projects and has been discussed in the community and GitHub issues [Wasp apps inside NPM projects don't work].
How to resolve:
1. Clean up duplicate node_modules:- Delete all
node_modules
folders in your project, including those in subdirectories like .wasp/build/web-app/node_modules
.
- Delete any package-lock.json
or yarn.lock
files.
- Run wasp clean
if you haven't already, as this will remove .wasp
and node_modules
folders and force a fresh install [Discord: Cannot find module 'wasp/entities'].
2. Reinstall dependencies:- Run
wasp start
to let Wasp recompile and reinstall everything.
3. Check for nested npm projects:- Make sure there are no other
package.json
or node_modules
folders in parent directories that could interfere with module resolution [Wasp apps inside NPM projects don't work].
4. Node version:- Ensure you are using a Node.js version compatible with your Wasp version. Sometimes, mismatched Node versions can cause unexpected issues [Node version conflict]. If you continue to have issues, please provide more details about your project structure and any customizations to your build process. The knowledge sources do not mention a direct fix for this specific
queryCache
type error, but the above steps are the recommended approach for similar module resolution and type mismatch issues in Wasp projects.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Zuck, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@Zuck we had some trouble with TanStack Query releases lately, they’ve pushed two bad releases in the past two weeks.
Can you try running
wasp clean
and building again?@Carlos you can close this, it had to do with a version of node i was running in deployment + probably a specific tanstack issue.
was getting the same issue. Upgraded wasp from 0.16.4 to 0.16.7, and it went away. I also ran
wasp clean