W
Wasp3d ago
Gökhan

Cannot find module 'wasp/...' on everything wasp related, on OpenSaaS.

Every wasp library in the project gives typescript error in VSCode which is very distracting. Is there a way to fix it? Tried reloading the TS server, cleaning wasp and building it back again. Running 0.18.0 in Ubuntu WSL.
2 Replies
kapa.ai
kapa.ai3d ago
Hi @Gökhan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The "Cannot find module 'wasp/...'" TypeScript errors in VSCode are a known pain point for Wasp projects, especially with OpenSaaS and custom code. This typically happens because the special Wasp imports (like wasp/server, wasp/entities, etc.) are generated by the Wasp compiler and only exist after running wasp start or wasp build. If VSCode or the TypeScript server can't find them, it will show these errors. Here are some steps and context from the knowledge sources: 1. Run the Wasp Compiler
Make sure you've run wasp start at least once. This compiles the SDK and generates the wasp/* modules. If you haven't, the imports won't resolve and you'll get these errors. If things seem broken, try wasp clean followed by wasp start to regenerate everything. This has resolved similar issues for others in the communityDiscord: Error solutions. 2. VSCode Integration
Wasp provides a VSCode extension for syntax highlighting and language features, but the TypeScript server may still complain about wasp/* imports because they are not standard npm modules and only exist after compilationDocs: Editor Setup. 3. Known Limitation
This is a recognized issue in the Wasp ecosystem. There are ongoing discussions about improving IDE support, possibly by generating a local npm package for the Wasp runtime/types, which would help VSCode and TypeScript recognize these importsGithub: IDE support discussion. 4. Workarounds
- After running wasp start, try reloading the VSCode window or the TypeScript server. - If you still see errors, they are mostly cosmetic and do not affect the actual running of your app, as confirmed by other users. - There is no official fix yet, but the Wasp team is aware and considering improvements. Summary:
You are not alone—these TypeScript errors are a known issue due to how Wasp generates its modules. Running wasp start and cleaning the project can help, but some errors may persist in the editor until better IDE support is implemented. The errors do not affect your app's runtime. If you want to follow progress or contribute feedback, you can track the related issues here: Proper IDE support for Wasp projects. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Gökhan, 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?
Filip
Filip23h ago
Hey @Gökhan, we'll need more details. What kind of errors, where do they show up. Please upload screenshots and/or copy paste error text messages.

Did you find this page helpful?