Standalone .wasp output generation

I'm encountering this problem a lot, where I kind of reach a racing condition. I declare a function in my operations.ts before declaring it in the main.wasp file first, causing my wasp start to break. I'll have to undo my operations.ts changes, declare the Query/Action in the main.wasp, do a wasp start so it generates the .wasp/out types, then implement my operations.ts changes. Not to mention when you forgot a small change in main.wasp having to do all that again. Is there a wasp command that only generates the .wasp/out types?
10 Replies
kapa.ai
kapa.ai2mo ago
Hi @abiroot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, there is a command that generates the .wasp/out types. You can use the wasp compile command. This command will overwrite the code in .wasp/out with the freshly generated code. You might want to store the changes you did manually so they are not lost at this moment in case templates are not completely correct and you want to look into your manual changes for guidance source (https://github.com/wasp-lang/wasp/issues/168). After running wasp compile, you can then run wasp start and if you succeeded, the app will behave as it should. Here is the sequence of commands:
wasp compile
wasp start
wasp compile
wasp start
Remember to save your manual changes before running these commands to avoid losing them. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @abiroot, 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?
abiroot
abirootOP2mo ago
wasp compile still not working, the query type is not being generated
Filip
Filip2mo ago
Hey @abiroot, thanks for reporting this and phrasing it nicely. That's been a pain for me too. We decided to wait to see if it bothers any of our users before investing time into it. And I think you're the first one to mention it. Thanks! I created an issue to track it and linked to this thread: https://github.com/wasp-lang/wasp/issues/2304 In the meantime, the only solutions are to either: 1. Always declare your operations in main.wasp before implementing them 2. Remove all types from the JS file and return them later (like I think you're doing).
Not to mention when you forgot a small change in main.wasp having to do all that again.
What do you mean by this? Outside of the issue described above, this shouldn't be happening.
abiroot
abirootOP2mo ago
Thank you @sodic ! Really appreciate your efforts.
Not to mention when you forgot a small change in main.wasp having to do all that again.
For example, when I have to rename the action/query name from main.wasp
MEE6
MEE62mo ago
Wohooo @abiroot, you just became a Waspeteer level 1!
Filip
Filip2mo ago
But Wasp start should pick up on that. Does it not? Oh, I guess it's the same type-related problem. I'll try it out, thanks! And you're welcome!
abiroot
abirootOP2mo ago
Hey guys, any idea why I'm getting this error whenever I do a file change: wasp-bin: /Users/<user>/Projects/WASP/<project>/app/public/: getDirectoryContents:openDirStream: resource exhausted (Too many open files) It used to auto compile, now wasp start breaks whenever I change a file
Filip
Filip2mo ago
Hmm, you might be hitting the computer's resources limit with something how big is the public directory?
abiroot
abirootOP2mo ago
Still the default actually: total 2520 drwxr-xr-x@ 6 lamba staff 192 Sep 23 20:59 . drwxr-xr-x@ 22 lamba staff 704 Sep 24 17:18 .. -rw-r--r--@ 1 lamba staff 0 Sep 23 20:59 .gitkeep -rw-r--r--@ 1 lamba staff 860453 Sep 23 20:59 banner.png -rw-r--r--@ 1 lamba staff 171689 Sep 23 20:59 favicon.ico -rw-r--r--@ 1 lamba staff 252425 Sep 23 20:59 public-banner.png
Filip
Filip2mo ago
Want results from more Discord servers?
Add your server