[ Wasp ] core/auth.ts(17,7): error TS2742
I already did a
wasp clean
and wasp start
.
Last night worked fine, this morning is not compiling:be: :
Why the error is in a compiled app file (.wasp/)
[ Wasp ] core/auth.ts(17,7): error TS2742: The inferred type of 'auth' cannot be named without a reference to 'express/node_modules/@types/express-serve-static-core'. This is likely not portable. A type annotation is necessary.
❌ --- [Error] Your wasp project failed to compile: -------------------------------
- SDK build failed with exit code: 1
2 Replies
Hi @NEROX. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
This error appears to be related to TypeScript type inference issues in the compiled Wasp files. The error occurs in the
.wasp/
directory, which contains auto-generated code that you shouldn't modify directly.
Based on the knowledge sources, there are a few potential solutions to try:
1. Run wasp clean
followed by wasp start
again
I see you've already tried this, but sometimes it helps to run it multiple times, especially if there were any recent changes to your project or Wasp version.
2. Check your Node.js version
Some users have reported issues with specific Node.js versions. Wasp is known to work well with Node.js v18, so you might want to ensure you're using a compatible version.
3. Check for recent changes in your project
If it was working last night but not this morning, consider what changes might have been made to your project since then.
4. Look for auth-related configuration issues
The error is specifically in core/auth.ts
, which suggests there might be an issue with your auth configuration in your main .wasp
file.
This type of error is often related to TypeScript's type inference and dependencies. The specific error message indicates that TypeScript is having trouble with type references related to Express.
If none of these solutions work, you might need to:
1. Try a more thorough cleanup by deleting the .wasp
directory and node_modules
folders manually, then running wasp start
again.
2. Check if you have any custom patches or modifications that might be causing conflicts.
Several users have reported similar issues in Discord support threads, and they were often resolved by running wasp clean
or by fixing configuration issues in their main .wasp
file.
Discord support thread: Missing "./auth/email" specifier in "wasp" package shows a similar issue that was related to auth configuration.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @NEROX, 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?Well, fixed after several
wasp clean
and wasp start