mario.p
mario.p
WWasp
Created by mario.p on 3/28/2025 in #🙋questions
How to use wasp cli with a built project on a prod server?
Hi! I'm trying to release my first project with WASP on a staging server. I would like to understand how I can use the wasp cli with a built project. The idea is to be able to use the "wasp db" features mainly, such as the ability to seed or access "wasp db studio" even if it is not a recommended practice in production. I managed, obviously, to deploy everything using Docker, I can also install the wasp utility but rightly it does not find a wasp project to hook into. Do you have any ideas? Thanks!
14 replies
WWasp
Created by mario.p on 3/27/2025 in #🙋questions
🚀 EXPO + WASP: Help integrating mobile frontend with backend authentication! 🔐
Hello world! I would like to develop a mobile frontend with EXPO and integrate it with the backend written with WASP. However, I have no idea how to use the authentication part (email and social) of WASP. Does anyone have any advice/guides on how I could proceed? Thank you!
7 replies
WWasp
Created by mario.p on 3/13/2025 in #🙋questions
How to integrate Swagger UI?
Hi @kapa.ai, can you explain me how can I integrate Swagger UI into a Wasp project? Thanks!
11 replies
WWasp
Created by mario.p on 3/9/2025 in #🙋questions
How to import "Routes" from another file into Main.wasp? If possible.
Hi guys, I'm looking for a way to define Routes in Wasp in a separate file (myroutes.wasp) and then import them into Main.wasp but I can't find anything from the documentation. Does anyone have a suggestion or a solution? Thanks!
8 replies
WWasp
Created by mario.p on 2/17/2025 in #🙋questions
"Property 'value' does not exist on type XYZ"- but it exists. What am I doing wrong?
Hi everyone! In advance I would say that I am new to this technology and I am stuck with something that looks like a bug in WASP but I am not sure. The error I receive when the build fails: Property 'user' does not exist on type '{ id: number; userId: string; } The code: File mypage.tsx
import { type CourseChapter, type Course, UserInstructor, User } from 'wasp/entities';

// ... other code

function CourseForm({ courseId }: { courseId: string }) {

const { data: instructors } = useQuery(getUserInstructors)

// other code...
<select>
{instructors?.map((instructor: UserInstructor) => (
<option key={instructor.id} value={String(instructor.id)}>
{instructor.user.username}
</option>
))}
</select>
// ...
import { type CourseChapter, type Course, UserInstructor, User } from 'wasp/entities';

// ... other code

function CourseForm({ courseId }: { courseId: string }) {

const { data: instructors } = useQuery(getUserInstructors)

// other code...
<select>
{instructors?.map((instructor: UserInstructor) => (
<option key={instructor.id} value={String(instructor.id)}>
{instructor.user.username}
</option>
))}
</select>
// ...
This is my operations file File operations.ts
import { Course, CourseCategory, CourseChapter, UserInstructor } from 'wasp/entities'
import { type GetCourseCategories, type GetUserInstructors, type GetCourses, type GetCourseChapters } from 'wasp/server/operations'

// ... other code

export const getUserInstructors: GetUserInstructors<void, UserInstructor[]> = async (args, context) => {
return context.entities.UserInstructor.findMany({
orderBy: { id: 'asc' },
include: {
user: {
select: {
id: true,
username: true
}
}
},
})
}
import { Course, CourseCategory, CourseChapter, UserInstructor } from 'wasp/entities'
import { type GetCourseCategories, type GetUserInstructors, type GetCourses, type GetCourseChapters } from 'wasp/server/operations'

// ... other code

export const getUserInstructors: GetUserInstructors<void, UserInstructor[]> = async (args, context) => {
return context.entities.UserInstructor.findMany({
orderBy: { id: 'asc' },
include: {
user: {
select: {
id: true,
username: true
}
}
},
})
}
File Schema.prisma
// ...
model UserInstructor {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String @unique
courses Course[]
}
// ...
model UserInstructor {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String @unique
courses Course[]
}
What I have already tried that didn't work: - wasp clean - Adding new fields to the UserInstructor model and running wasp db dev-migrate I am working on Ubuntu 22 with Wasp 0.16.2 I hope someone can help me 🙂 Thanks!
12 replies