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.
6 Replies
Hi @randopixel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Wohooo @randopixel, you just became a Waspeteer level 2!
----------------------
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?@randopixel i didn't quite get what the issue is. Can you explain it in more detail + share the screenshot?
anything that refers to a wasp endpoint, like:
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?