Did I accidentally delete a folder/files? 'wasp/client/router' & 'wasp/client/auth'
Extreme newbie, I may be way off base but I feel like I am missing two files.
33 Replies
Hi @Kelly Ellie. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It's possible that you might be looking in the wrong place for these files. The
wasp/client/router
and wasp/client/auth
are not actual files or directories in your project. Instead, they are modules provided by the Wasp package that you can import in your code.
For instance, in the Wasp documentation (https://wasp-lang.dev/docs/auth/username-and-pass#4-create-the-client-pages), you can see an example where wasp/client/auth
is imported:
This line of code is importing the LoginForm
and SignupForm
components from the wasp/client/auth
module. These components are provided by Wasp and can be used in your application.
If you're getting an error that these modules cannot be found, it might be due to a problem with your Wasp installation or your project setup. You could try running wasp clean
to remove all generated code and other cached artifacts, and then wasp start
to start your application again. If the problem persists, you might want to check your Wasp installation or seek help from the Wasp community.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Kelly Ellie, 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?Are you running
wasp start
?Yes, I save my file then restart wasp.
you don't have to restart wasp after saving, it will refresh your app automatically
also, you shouldn't edit the contents of the
.wasp
folder
Could you try restarting the TypeScript server?
@kapa.ai how can I restart the typescript server in vscode?Let me check the knowledge base for you. One moment! :books:
----------------------
Restarting the TypeScript server in VSCode can help solve issues related to IntelliSense, autocompletion, and more. Here's how you can do it:
1. Open the Command Palette in VSCode. You can do this by pressing
Ctrl+Shift+P
on Windows/Linux or Cmd+Shift+P
on macOS.
2. In the Command Palette, type "TypeScript: Restart TS Server" and select it from the dropdown list.
This will restart the TypeScript server in VSCode. If you're working on a Wasp project and encountering issues, restarting the TypeScript server can sometimes help, especially if the issues are related to type checking or autocompletion.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Vinny (@Wasp), 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?TY Vinny. I restarted the TypeScript server but the issue persists. I don't think I touched anything in the .wasp folder
Wohooo @Kelly Ellie, you just became a Waspeteer level 2!
try running
wasp clean
and then wasp start
againwasp clean and wasp start have completed successfully, the issue persists. š
Shold there be a .wasp/client folder?
are you running wasp on windows with WSL?
yes
clean and start output
hmm paging maybe @miho or @sodic can help you here
but to be honest @Kelly Ellie I don;t see the issue. your app is running fine, isn't it?
Do you get any errors in the terminal or the browser console?
Im not seeing any issue functionally. In VScode I am seeing the red dots and underlined sections in Header.tsx . The underlined path is pointing to 'wasp/client/auth' but I dont see a folder named 'client' under .wasp
I get this problem a lot and restarting the typescript server does the trick
Thanks! I did try that earlier. I tried it again now and the issue persists. Where should this "wasp/client" relative to app?
Ok, so since everything is working in the terminal (you're not getting any typescript errrors), I'd say that this is the IDE acting out. If the app works normally, the files are definitely there.
Still, if you'd like to check for yourself, the file you're looking for is:
/mnt/e/opensaas/cribsai/app/node_modules/wasp/client/auth/index.ts
And like @Kelly Ellie said, restarting the TS server usually solves these kinds of problems. Hmm
Can you try "Ctrl + shift + P" > "Select typescript version" > "Use project version"
And then restart the server again "Ctrl + shift + P" > "Restart TS server"
See if that helpsFiles š Unfortunately Select typescript version didn't bring anything back
Very strange. What error does it claim it has?
No error, it just doesnt recognize the command as seen in this screenshot
That's not the verbatim name of the command
And they often change the words between versions
TypeScript Compiling with Visual Studio Code
Learn about TypeScript compiling with Visual Studio Code.
I have double down on this -- I actually have this error quite often and restarting doesn't seem to do trick (sorry!)
@Filip you all really don't have this error at all?
Wohooo @Adam, you just became a Waspeteer level 1!
Let's maybe go through the basics:
1. What kind of errors do you see? Does your app work?
2. Do you see errors in the browser console?
3. Do you see errors in the terminal? Which kind of errors?
4. Which Wasp version are you using? Are you using Open SaaS?
Thanks š
Thanks for jumping in @miho, I'll take it over again.
@Adam, can you answer Miho's questions and share the project?
From what I remember, you aren't getting any Wasp error, only IDE false positives.
Heyo, sure!
1. App works!
2. No errors in the browser console when I inspect the code.
3. It's just the IDE errors. Cannot find module 'wasp/client/auth' or its corresponding type declarations.ts(2307) (also for operations) -- I guess it's something in relation to
"wasp": "file:.wasp/out/sdk/wasp",
4. 14.1 and yes!
Steps Attempted:
https://gist.github.com/tonysneed/bb6d442103a057578a9498f106e45ac5?permalink_comment_id=4008697
(1) I created this in workspace in visual studio code but no luck (2) when I use the workspace version of typescript
{
"typescript.tsdk": "app\node_modules\typescript\lib"
}
I can share my code, but I'm a bit ashamed, it's very messy.
š If I have you here, can I ask also for question about state, I see that you have implemented that as local storage (as you save the sidebar state even though the sidebar doesn't work) Would you recommend to save state that way our use like zustand. The last topic about state happened a year ago and wanted to know if you all think differently
!solved x2
In VSCode, one must connect to wsl system (if windows), it must look like this at the bottom left. Just connecting via wsl does not suffice.
For state mangement, zustand is most likely needed, the local storage example is relatively simple with just a key and json string.
Hey @Adam, glad you got it working!
Just to make sure if there's something we should add to the guide...
I don't use WSL so I'm unfamiliar with the setup, but is what you are describing here already covered by https://wasp-lang.dev/blog/2023/11/21/guide-windows-development-wasp-wsl#setting-up-vs-code or should we extend it?
The configuration written is completely correct, I would add a troubleshooting section, or when people mention this error I would suggest them to look at this
maybe change
In both places, we have WSL: Ubuntu written, as is shown on screenshots.
to say we should have WSL: Ubuntu written, as is shown on screenshots.
GitHub
Change wording in the WSL blog post by sodic Ā· Pull Request #2278 Ā·...
A small fix based on this.
thanks!