Error adding email auth

Following: https://wasp-lang.dev/docs/auth/email I am getting an error: import { LoginForm, SignupForm, VerifyEmailForm, ForgotPasswordForm, ResetPasswordForm, } from 'wasp/client/auth' Module '"wasp/client/auth"' has no exported member 'ForgotPasswordForm'.ts(2305) ⚠ Error (TS2305) | Module has no exported member ForgotPasswordForm . import ForgotPasswordForm Module '"wasp/client/auth"' has no exported member 'ForgotPasswordForm'.ts(2305) ⚠ Error (TS2305) | Module has no exported member ForgotPasswordForm . import ForgotPasswordForm Module '"wasp/client/auth"' has no exported member 'ResetPasswordForm'.ts(2305) ⚠ Error (TS2305) | Module has no exported member ResetPasswordForm . import ResetPasswordForm I recently migrated from 0.15.0 to 0.16.0.
Email | Wasp
Wasp supports e-mail authentication out of the box, along with email verification and "forgot your password?" flows. It provides you with the server-side implementation and email templates for all of these flows.
10 Replies
kapa.ai
kapa.ai3mo ago
Hi @InterestEmpire. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
MEE6
MEE63mo ago
Wohooo @InterestEmpire, you just became a Waspeteer level 1!
kapa.ai
kapa.ai3mo ago
---------------------- Based on the information provided in the knowledge sources, it appears that you're encountering an issue related to recent changes in the Wasp framework's import structure. This problem is likely due to the migration from version 0.15.0 to 0.16.0. Let me explain the issue and provide a solution: The error you're seeing suggests that the import path for the authentication components has changed. In the newer versions of Wasp, the correct import path for these components is different from what you're currently using. To resolve this issue, you should update your import statement as follows:
import {
LoginForm,
SignupForm,
VerifyEmailForm,
ForgotPasswordForm,
ResetPasswordForm,
} from 'wasp/client/auth'
import {
LoginForm,
SignupForm,
VerifyEmailForm,
ForgotPasswordForm,
ResetPasswordForm,
} from 'wasp/client/auth'
This import statement is correct and should work in Wasp version 0.16.0. The reason for this change is explained in a Discord support thread Missing "./auth/email" specifier in "wasp" package, where it was mentioned that the import should now be from wasp/client/auth instead of the previous path. If you're still experiencing issues after making this change, it's possible that the migration script didn't fully update all your files. As mentioned in the Discord thread, some paths (especially those using @shared/...) might not have been converted automatically. To ensure everything is up to date, you might want to: 1. Double-check all your import statements related to authentication. 2. Make sure you've run the migration script provided by Wasp for upgrading from 0.15.0 to 0.16.0. 3. Manually update any remaining outdated import paths, especially those using @shared/.... If you continue to face issues after these steps, you may want to consult the Wasp documentation on Email Authentication for the most up-to-date information on setting up email authentication in your Wasp project. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @InterestEmpire, 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?
InterestEmpire
InterestEmpireOP3mo ago
@kapa.ai i do have this: import { LoginForm, SignupForm, VerifyEmailForm, ForgotPasswordForm, ResetPasswordForm, } from 'wasp/client/auth'
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Thank you for providing that additional information. It seems that you are using the correct import statement, which aligns with the latest Wasp documentation. However, you're still encountering errors related to ForgotPasswordForm and ResetPasswordForm. Let's investigate this further. Based on the knowledge sources provided, there are a couple of possibilities: 1. Component naming inconsistency: There's a chance that the component names might have changed. According to the Auth UI documentation, the correct component names are: - LoginForm - SignupForm - ForgotPasswordForm - ResetPasswordForm - VerifyEmailForm These match the names you're trying to import, so this doesn't seem to be the issue. 2. Incomplete migration: As mentioned in the Discord support thread, there might be issues with the migration script not updating all files correctly. To troubleshoot this issue, I suggest the following steps: 1. Double-check your Wasp version: Make sure you're actually running version 0.16.0. You can check this in your package.json file or by running wasp version in your terminal. 2. Clean and rebuild your project: Try running wasp clean followed by wasp start to ensure all generated files are up-to-date. 3. Check for any warnings or errors in the Wasp compiler output: Look for any messages that might indicate why these components are not being exported correctly. 4. Verify the auth setup in your main.wasp file: Ensure that you have properly set up email authentication as described in the Email Authentication documentation. If you've done all of these steps and are still encountering the same error, it's possible that there might be a bug in the current version of Wasp. In this case, I would recommend: 1. Checking the Wasp GitHub issues to see if this problem has been reported. 2. If you don't find an existing issue, consider opening a new one to report this problem. 3. Reaching out to the Wasp community on their Discord channel for more immediate support. Remember to provide details about your Wasp version, the exact error message, and the steps you've taken to troubleshoot when seeking help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @InterestEmpire, 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?
Vinny (@Wasp)
Vinny (@Wasp)3mo ago
Maybe @miho knows what's up here? What does the auth property look like in your main.wasp file? it should look something like this (note that we've specified a defined PasswordResetRoute):
app myApp {
wasp: {
version: "^0.16.0"
},
title: "My App",
auth: {
// 1. Specify the user entity (we'll define it next)
userEntity: User,
methods: {
// 2. Enable email authentication
email: {
// 3. Specify the email from field
fromField: {
name: "My App Postman",
},
// 4. Specify the email verification and password reset options (we'll talk about them later)
emailVerification: {
clientRoute: EmailVerificationRoute,
},
passwordReset: {
clientRoute: PasswordResetRoute,
},
},
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
},
}
app myApp {
wasp: {
version: "^0.16.0"
},
title: "My App",
auth: {
// 1. Specify the user entity (we'll define it next)
userEntity: User,
methods: {
// 2. Enable email authentication
email: {
// 3. Specify the email from field
fromField: {
name: "My App Postman",
},
// 4. Specify the email verification and password reset options (we'll talk about them later)
emailVerification: {
clientRoute: EmailVerificationRoute,
},
passwordReset: {
clientRoute: PasswordResetRoute,
},
},
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
},
}
miho
miho3mo ago
Generating a new open saas app, this works for me.
No description
miho
miho3mo ago
Did you run wasp start? Did you restart VS Code or the TS Language Server?
No description
InterestEmpire
InterestEmpireOP3mo ago
@Vinny (@Wasp) Here is the auth
app.auth({
userEntity: 'User',
methods: {
google: {
userSignupFields: { import: 'getUserFields', from: '@src/server/auth.ts' },
configFn: { import: 'config', from: '@src/server/auth.ts' }
},
email: {
fromField: {
name: "Me",
email: "my_email@my_domain.com"
},
emailVerification: {
clientRoute: EmailVerificationRoute,
},
passwordReset: {
clientRoute: PasswordResetRoute,
},
}
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
});
app.auth({
userEntity: 'User',
methods: {
google: {
userSignupFields: { import: 'getUserFields', from: '@src/server/auth.ts' },
configFn: { import: 'config', from: '@src/server/auth.ts' }
},
email: {
fromField: {
name: "Me",
email: "my_email@my_domain.com"
},
emailVerification: {
clientRoute: EmailVerificationRoute,
},
passwordReset: {
clientRoute: PasswordResetRoute,
},
}
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
});
@miho It also works for me if I start a new wasp app with the opensaas template, email account creation works fine there. Have restarted cursor and ts language server. Ran wasp start too.
Vinny (@Wasp)
Vinny (@Wasp)3mo ago
hm then it must be related to a change you made in your PasswordResetRoute or similar file. Can you share those ??

Did you find this page helpful?