W
Wasp3mo ago
randopixel

Clear wasp api endpoint imports errors in ide?

Is there a way to fix these annoying things? VSCode errors every wasp api endpoint in the imports.
13 Replies
kapa.ai
kapa.ai3mo ago
Hi @randopixel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
MEE6
MEE63mo ago
Wohooo @randopixel, you just became a Waspeteer level 2!
kapa.ai
kapa.ai3mo ago
---------------------- Yes, there are ongoing discussions and efforts to improve IDE support for Wasp, including handling of imports. One of the issues discussed is the IDE not recognizing certain imports, especially those starting with @wasp. This is due to the special way Wasp handles these imports, which are not standard Node.js imports. A potential solution discussed in the community is to generate an npm package with Wasp's runtime and types, similar to what Prisma does. This would make it easier for the IDE to recognize and handle these imports (source (https://github.com/wasp-lang/wasp/issues/570)). Another suggestion is to improve the structure of Wasp SDK imports, which could make them more intuitive and easier to handle for both developers and IDEs (source (https://github.com/wasp-lang/wasp/issues/1657)). However, these are still under discussion and not yet implemented. For now, you might have to tolerate these IDE errors, as they should not affect the actual running of your Wasp application. For more information and updates, you can follow the relevant discussions on the Wasp Github page. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @randopixel, 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?
martinsos
martinsos3mo ago
@randopixel i didn't quite get what the issue is. Can you explain it in more detail + share the screenshot?
randopixel
randopixelOP3mo ago
anything that refers to a wasp endpoint, like:
No description
martinsos
martinsos3mo ago
You mean any wasp import? That means your project is not set up as it should be. Have you tried doing wasp clean? Does wasp start run for you ok? Any errors in it?
randopixel
randopixelOP2mo ago
Everything works as expected. All of the endpoints are valid on use. the operations all get aggregated and useable at compile. No errors except for what you see @martinsos
miho
miho2mo ago
Do other Typescript projects work for you in VS Code? Did you try restarting the Typescript Language server? Which Wasp version are you using?
randopixel
randopixelOP2mo ago
Yes, Yes and 0.14.2
miho
miho2mo ago
@sodic could you jump in, I'm not sure what to debug next
Filip
Filip2mo ago
What's the error reported by the IDE?
randopixel
randopixelOP2mo ago
Cannot find module 'wasp/client/operations' or its corresponding type declarations.ts(2307) same for all wasp endpoints. It does not affect operation. Everything works as expected.
No description
Filip
Filip2mo ago
So it's definitely an IDE issue. We had a user with a similar problem, can you try this (I'm guessing you're on Windows): https://discord.com/channels/686873244791210014/1277574894107754506/1282744707654352948
Want results from more Discord servers?
Add your server