W
Wasp3w ago
Yumyum

Cannot find module

Hello i am trying to run a migration to an existing project that is newly installed on my laptop and keep getting errors such as: [ Wasp ] auth/useAuth.ts(8,32): error TS2307: Cannot find module '@tanstack/react-query' or its corresponding type declarations. [ Wasp ] client/operations/hooks.ts(9,8): error TS2307: Cannot find module '@tanstack/react-query' or its corresponding type declarations. [ Wasp ] client/operations/queryClient.ts(1,48): error TS2307: Cannot find module '@tanstack/react-query' or its corresponding type declarations. [ Wasp ] client/test/vitest/helpers.tsx(7,50): error TS2307: Cannot find module '@tanstack/react-query' or its corresponding type declarations. ❌ --- [Error] Your wasp project failed to compile: ------------------------------- - SDK build failed with exit code: 2 ❌ --- [Error] Compilation of wasp project failed: -------------------------------- 1 errors found
15 Replies
kapa.ai
kapa.ai3w ago
Hi @Yumyum. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It looks like you're encountering module resolution errors when trying to run a migration on your Wasp project. This is a common issue that can happen when dependencies aren't properly installed or when there are conflicts between different installations of the same package. The error messages indicate that your project can't find the @tanstack/react-query package, which is a dependency used by Wasp's SDK. Here are a few solutions you can try: 1. Clean and restart your project:
wasp clean
wasp start

wasp clean
wasp start

This will delete the .wasp folder and node_modules, then reinstall everything from scratch, which often resolves module resolution issues Discord support thread. 2. If that doesn't work, you might be experiencing a "double installation" issue, where React or other packages are installed in multiple locations, causing conflicts. This can happen especially in nested project structures or when a Wasp app is inside an NPM project GitHub Issue #1792. 3. Check if your project is inside another NPM project (i.e., if there's a package.json file or node_modules directory higher up in your file tree). This can cause module resolution conflicts GitHub Issue #1792. 4. Make sure you're running the Wasp compiler with wasp start before trying to use any of the wasp/* packages, as the SDK needs to be compiled first Discord support thread. If the issue persists after trying these solutions, you might want to check your Wasp version with wasp version to ensure you're using a compatible version for your project. Let me know if any of these solutions work for you! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Yumyum, 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?
miho
miho3w ago
Can you share your package.json file here?
Yumyum
YumyumOP3w ago
Yes, i removed some things but now get this
Yumyum
YumyumOP3w ago
{
"name": "opensaas",
"type": "module",
"dependencies": {
"@aldabil/react-scheduler": "^2.9.2",
"@aws-sdk/client-s3": "^3.523.0",
"@aws-sdk/s3-request-presigner": "^3.523.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@faker-js/faker": "8.3.1",
"@google-analytics/data": "4.1.0",
"@headlessui/react": "1.7.13",
"@lemonsqueezy/lemonsqueezy.js": "^3.2.0",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.7",
"apexcharts": "^4.5.0",
"clsx": "^2.1.0",
"date-fns": "^3.2.0",
"headlessui": "^0.0.0",
"node-fetch": "3.3.0",
"openai": "^4.55.3",
"prettier": "3.1.1",
"prettier-plugin-tailwindcss": "0.5.11",
"prisma": "5.19.1",
"react": "^18.2.0",
"react-apexcharts": "^1.4.1",
"react-calendar": "^5.0.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-icons": "4.11.0",
"react-leaflet": "^4.2.0",
"react-router-dom": "^6.26.2",
"rrule": "^2.8.1",
"stripe": "11.15.0",
"tailwind-merge": "^2.2.1",
"vanilla-cookieconsent": "^3.0.1",
"wasp": "file:.wasp/out/sdk/wasp",
"zod": "^3.23.8"
},
"devDependencies": {
"@tsconfig/node18": "latest",
"@types/cors": "^2.8.5",
"@types/express": "^4.17.13",
"@types/geojson": "^7946.0.16",
"@types/jest": "^29.5.14",
"@types/react": "^18.0.37",
"prisma": "5.19.1",
"typescript": "^5.1.0",
"vite": "^4.3.9"
},
"scripts": {
"deploy": "REACT_APP_GOOGLE_ANALYTICS_ID=G-DWZ2RP5FNY REACT_APP_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_eVabLOefL9VQcvu000 wasp deploy fly deploy"
},
"version": "1.0.0",
"main": "index.js",
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
{
"name": "opensaas",
"type": "module",
"dependencies": {
"@aldabil/react-scheduler": "^2.9.2",
"@aws-sdk/client-s3": "^3.523.0",
"@aws-sdk/s3-request-presigner": "^3.523.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@faker-js/faker": "8.3.1",
"@google-analytics/data": "4.1.0",
"@headlessui/react": "1.7.13",
"@lemonsqueezy/lemonsqueezy.js": "^3.2.0",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.7",
"apexcharts": "^4.5.0",
"clsx": "^2.1.0",
"date-fns": "^3.2.0",
"headlessui": "^0.0.0",
"node-fetch": "3.3.0",
"openai": "^4.55.3",
"prettier": "3.1.1",
"prettier-plugin-tailwindcss": "0.5.11",
"prisma": "5.19.1",
"react": "^18.2.0",
"react-apexcharts": "^1.4.1",
"react-calendar": "^5.0.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-icons": "4.11.0",
"react-leaflet": "^4.2.0",
"react-router-dom": "^6.26.2",
"rrule": "^2.8.1",
"stripe": "11.15.0",
"tailwind-merge": "^2.2.1",
"vanilla-cookieconsent": "^3.0.1",
"wasp": "file:.wasp/out/sdk/wasp",
"zod": "^3.23.8"
},
"devDependencies": {
"@tsconfig/node18": "latest",
"@types/cors": "^2.8.5",
"@types/express": "^4.17.13",
"@types/geojson": "^7946.0.16",
"@types/jest": "^29.5.14",
"@types/react": "^18.0.37",
"prisma": "5.19.1",
"typescript": "^5.1.0",
"vite": "^4.3.9"
},
"scripts": {
"deploy": "REACT_APP_GOOGLE_ANALYTICS_ID=G-DWZ2RP5FNY REACT_APP_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_eVabLOefL9VQcvu000 wasp deploy fly deploy"
},
"version": "1.0.0",
"main": "index.js",
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
miho
miho3w ago
Please run npm ls react in the root of your project 🙂 + npm ls @tanstack/react-query and share the output here
Yumyum
YumyumOP3w ago
/mnt/c/users/ayman/desktop/booking/Rezervera-main └── (empty) /mnt/c/users/ayman/desktop/booking/Rezervera-main └── (empty)
miho
miho3w ago
Make sure to run in the Wasp project root, that might be the app dir if you are using Open Saas
Yumyum
YumyumOP3w ago
Here you go 🙂
Yumyum
YumyumOP3w ago
npm ls @tanstack/react-query [email protected] /mnt/c/users/ayman/desktop/booking/Rezervera-main/app └─┬ [email protected] -> ./.wasp/out/sdk/wasp └── @tanstack/[email protected]
miho
miho3w ago
The logs don't give any interesting info. Try doing wasp clean + rm package-lock.json and let's see what happens
Yumyum
YumyumOP3w ago
my wasp clean is pretty slow for some reason, I'll be back in 15min or so
MEE6
MEE63w ago
Wohooo @Yumyum, you just became a Waspeteer level 1!
miho
miho3w ago
Maybe you are using the Windows file system vs. Linux file system, I'd recommend following this guide to setting up WSL2 https://wasp.sh/blog/2023/11/21/guide-windows-development-wasp-wsl
Yumyum
YumyumOP3w ago
that worked, thanks alot I'll do this aswell I guess

Did you find this page helpful?