Wasp

W

Wasp

Join the community to ask questions about Wasp and get answers from other members.

Join

[Help] Getting CORS error on preflight request

I tried everything to fix this CORS error but if i try to access my backend server from different origin i get this cors error do you guys know why? I tried different things to enable cors for all domains but didn't work Like adding globalMiddleware or api level middle ware....
No description

Wasp typescript error

version = 0.16.2 logs ``` dylank in sunderer on  wardbox/v1 [!] via ⬢ v20.18.3 ...

Postgres ssl certificate in the final build

I need to secure connections to my Supabase database instance, and for that to happen I need to ship the CA / Root Certificate in the build directory so that the server can find it when running in a staging / production build. What's the recommended way to achieve that?...

WebSocket Not Working in Production – Docker Server Rejects Connections

Hi Wasp team, I am experiencing an issue with WebSocket connections in my self-hosted production environment. After investigating, I found that the Docker server itself is rejecting WebSocket connections. Issue Summary:...

Is there a way to generate prisma migrations without applying them immediately?

Sometimes I need to apply Prisma migrations that do not only require a DDL change, but also some additional SQL statements I'd need to add in to migrate data. For instance when splitting a field into multiple columns, for setting an initial value to a column after it's been introduced (without a default value), etc. Is there a recommended way to do it? Otherwise whenever I edit a migration after generating it with wasp db migrate.dev it resets my local DB which kinds of defeats the purpose of testing additional migration statements...

Deploy to github

When creating an opensaas project, should i deploy every folder separately with their own repository? Or just one repo that regroup them all?

Can the wasp db studio command be altered to take the connection string directly?

Can the wasp db studio command be altered to take the connection string directly in CLI instead of pulling it from env.server? Long story short, I have a hackintosh that is incapable of virtualization. Docker won't run on it. I am building everything on my laptop, but i would like to be able to at leats access the db in a easy way on the hackintosh. ...

Getting invalid email error even with a valid email, when uppercase letters are in the domain name

Using the builtin email auth with SendGrid, I have a user who discovered a bug. They put in their email address like this:
And they received this error from Wasp:
Validation failed: email must be a valid email
Validation failed: email must be a valid email
(wasp outright rejected it and never passed the email to SendGrid)...

TypeError: Cannot read properties of undefined (reading 'REACT_APP_STRIPE_MODE')

I am trying to add new client variable switch between stripe prod and test. But when I try to access the variable it can't find it . I tried two way to access it; import {env} from 'wasp/client'...

cannot find module /auth/ui

After upgrading from wasp 0.14.0 to 0.15.0 to 0.16.0 and run "wasp start", I get a blank screen and this error "Cannot find module '/Users/blahblahblah/app/.wasp/out/sdk/wasp/dist/client/auth/ui' imported from /Users/blahblahblah/app/.wasp/out/sdk/wasp/dist/client/auth/index.js". Any suggestions on how to fix this? Thanks....

Custom Aliases don't work after migrating from 0.15 to 0.16

I recently upgraded to Wasp v0.16 because I wanted to take advantage of the custom aliases. I installed shadcn using this guide, and got it working after swapping out the import paths and such as suggested. The problem is every time I add a new shadcn component the paths get written incorrectly and I have to go fix it. So I tried switching back to using aliases and Wasp just fails to compile with errors like Cannot find module '@/lib/utils' or its corresponding type declarations. The aliases are recognized by VSCode without any problems so I'm not sure why wasp is failing on this. Below are my settings main.wasp...

Why prisma instead of drizzle?

The only thing not to love about wasp is the decision to go with prisma instead of drizzle. One of the articles in the blog talks about how other attempts of creating the "Lavarel" of JS failed likely because they got to tightly coupled to the wrong technology (next js, etc). After reading Miho's answer in regards to replacing prisma with drizzle, I'm wondering if the Wasp team didn't, quite ironically, made the same mistake they pointed out on other wannabe JS full-service frameworks....
No description

Page with optional auth - How to get user data in React if the user is signed in?

If I set authRequired: true on a page in main.wasp, then I can get the user data just fine in the React front-end like:
export const MainPage = ({ user }: { user: AuthUser }) => {
export const MainPage = ({ user }: { user: AuthUser }) => {
BUT, if I set authRequired: false in main.wasp, then that user object is undefined. ...

Ejected Dockerfile does not work

i have 16.1 and this is what i get: ``` FROM node:18.18.0-alpine3.17 AS node FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied....

Setting NODE_ENV to 'test'

I am deploying my wasp app to fly.io for a testing environment. Eventho I set the NODE_ENV Variable in fly.io to 'test', my server thinks he is in production mode. When checking my servers logs i see the following code being executed: npm run db-migrate-prod && NODE_ENV=production npm run start How can i manipulate this? I am using wasp deploy fly deploy for the test deployment...

New error in deployment

[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'

Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'

Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
I don't see a src/server.ts in my codebase, any ideas here?...

Does anyone use Drizzle instead of Prisma?

I’m wondering if Wasp supports Drizzle or if someone is already using Drizzle in their Wasp project. I prefer it much more since the queries are a lot closer to SQL...

Puppeteer Scrapping: [ Server ] CAPTCHA detected!

[ Server ] Navigating to Google... [ Server ] Page content preview: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="origin-trial" content="A/kargTFyk8MR5ueravczef/wIlTkbVk1qXQesp39nV+xNECPdLBVeYffxrM8TmZT6RArWGQVCJ0LRivD7glcAUAAACQeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IkRpc2FibGVUaGlyZFBhcnR5U3RvcmFnZVBhcnRpdGlvbmluZzIiLCJleHBpcnkiOjE3NDIzNDIzOTksImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content=" ...

Examples of creating session with wasp 0.16.0

I want to create a user session via Wasp's auth hooks, but I can't find any good examples of using the existing auth utils. In old code snippets I see references to createSession but I can't find that anymore. Any suggested reading?

About Wasp TypeScript config

Noob question. In Wasp TS, when you declare an App: `const app = new App('todoApp', { title: 'ToDo App', wasp: { version: '^0.16.0' },...
Next