Error running wasp db migrate-dev on new project
I created a new wasp project with the OpenSaas template and ran the wasp db migrate-dev. However, I was greeted with the following error:
🐝 --- Building SDK... ------------------------------------------------------------
[ Wasp ] core/serialization/custom-register.ts(17,16): error TS2665: Invalid module name in augmentation. Module 'superjson' resolves to an untyped module at '/Users/hydrogen/Desktop/OneDealer/rag-saas/app/node_modules/superjson/dist/index.js', which cannot be augmented.
[ Wasp ] core/serialization/prisma.ts(50,16): error TS2665: Invalid module name in augmentation. Module 'superjson' resolves to an untyped module at '/Users/hydrogen/Desktop/OneDealer/rag-saas/app/node_modules/superjson/dist/index.js', which cannot be augmented.
❌ --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 2
❌ --- [Error] Compilation of wasp project failed: --------------------------------
1 errors found
I looked for solutions online but of no help. Could you help me with it?
6 Replies
Hi @spm. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources provided do not contain any information about the specific TypeScript error you encountered regarding module augmentation of superjson during the SDK build step in Wasp. The sources do discuss various issues with wasp db migrate-dev, such as long install times, permission issues, and general troubleshooting steps (like running wasp clean, checking memory, or running npm install manually in .wasp/out folders), but there is no mention of the superjson TypeScript error or its resolution.
If you haven't already, you might try the following general troubleshooting steps that have helped with other Wasp build issues:
- Run wasp clean to remove generated files and node_modules, then try wasp db migrate-dev again.
- Ensure you are using compatible versions of Wasp and its dependencies as defined in your main.wasp file.
- Check if your environment has enough memory, as low-memory environments (like small VPS or EC2 instances) can cause build failures or hangs.
- Try running npm install manually in the .wasp/out/web-app and .wasp/out/server directories after compiling with wasp compile, to see if more detailed errors appear.
However, for your specific TypeScript error with superjson, the knowledge sources do not provide a solution or even mention this problem. You may want to open a new issue on the Wasp GitHub or ask in the Wasp Discord for more targeted help, providing the full error message and your environment details.
If you have more context or logs, feel free to share them, and I can check again for any relevant information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @spm, 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?
Hi @spm, which wasp version are you using?
Using 0.17.1
I'd say this is fixed in 0.18.1
If you don't want to update, you can maybe add
"superjson": "2.2.2" to your package.json deps, re-generate your package-lock.json, and it should get pinned to an older compatible versionI manually added a superjson.d.ts file on my project to get around it.
Wohooo @spm, you just became a Waspeteer level 1!