Restarting language server constantly?
Hey all! Working with Wasp for the first time. I find myself having to restart the VSCode TS langauge server all the time because of the typegen. Is this pretty typical? Does anyone have an extension they use to force-restart on typegen?
9 Replies
Hi @Kerry Ritter. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it appears that the issue you're experiencing with constantly restarting the TypeScript language server in VSCode is not typical behavior for Wasp projects. However, there are a few relevant points to consider:
1. Wasp generates TypeScript configuration files (
tsconfig.json
) in the project directories to provide proper IDE support, including type definitions and go-to-definition functionality. These files are created during project creation and should be present in the src/{server,shared,client}
directories GitHub Issue #939.
2. There is an ongoing effort to improve IDE integration for Wasp projects, as evidenced by the open RFC (Request for Comments) discussing various approaches to enhance IDE support GitHub Issue #604.
3. The constant need to restart the language server might be related to how Wasp generates and updates type definitions. However, the knowledge sources don't provide specific information about a known issue causing frequent language server restarts.
Given the lack of specific information about your particular issue in the provided knowledge sources, I cannot offer a definitive solution or confirm if this is typical behavior. However, here are a few suggestions that might help:
1. Ensure you're using the latest version of Wasp, as newer versions may have improvements in type generation and IDE support.
2. Check if all the necessary tsconfig.json
files are present in your project directories. If they're missing, you may need to regenerate them or ensure they haven't been accidentally deleted.
3. Keep an eye on the Wasp GitHub repository for updates or issues related to IDE integration and TypeScript support.
If the problem persists, it would be helpful to report this issue on the Wasp GitHub repository or Discord channel, providing details about your setup and the specific behavior you're experiencing. The Wasp team and community might be able to provide more tailored assistance or confirm if this is a known issue they're working on.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Kerry Ritter, 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?Yeah I also find myself doing this quite often, but I always heard other people (not using Wasp) having the same issues. Maybe it occurs more often with Wasp? cc: @Filip
Yeah, very annoying. Like Vinny said, it's a very common issue in the ecosystem (not just Wasp) and happens whenever there's code generation or complex types.
That said, I haven't used any of the modern JS frameworks in a while, so @Kerry Ritter, if you could compare your experience with something else, that would mean a lot.
If we're much worse than everyone else, then we know where to focus our efforts π
My typical stack is a NestJS API + OpenAPI integrations that autogenerate the clientside types for my Remix apps (which is why I am so excited for Wasp!)
I have a similar problem there, but it's not quite as jarring because I am taking explicit action to regenerate types, so can quickly/easily restart the TS server. With Wasp, it's more integrated and automatic so I don't think to do it until I've thrown up my hands haha.
This makes development with Cursor very hard in Wasp - Cursor can't find the types, gets confused, and starts doing crazy things.
I wonder if the Wasp Language Server can listen for type generation events and automatically reboot the WLS and TLS.
I experienced the same issue, my solution was to install this extension.
I modified the Typescript file glob as follows (ensure you add the
tsbuildinfo
extension to the default list):
So the TLS now automatically restarts every time the Prisma client or Wasp output gets modified. You'll probably also want to disable the extension's notifications.nice!! i need this haha
Yup. I use Cursor (and Windsurf) too, so I understand just how annoying it can be π
π thanks for the tip
Oh nice tip. check it out @Filip.
Added it too. Let's see how it goes. Thanks @genyus
Also, @Kerry Ritter report back please and let us know if that fixed things for you. π