Wasp-lang

W

Wasp-lang

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

Join

delete entity

I have an entity called File which has an id. Give me an example action to delete a File

Error while compiling the project

[ Wasp ] prisma-runtime-library.d.ts(2,26): error TS2307: Cannot find module '@prisma/client/runtime' or its corresponding type declarations. [ Wasp ] server/_types/index.ts(6,8): error TS2307: Cannot find module 'express-serve-static-core' or its corresponding type declarations. [ Wasp ] tsconfig.json(2,14): error TS6053: File '@tsconfig/node18/tsconfig.json' not found. [ Wasp ] ../../../../node_modules/@testing-library/jest-dom/types/jest.d.ts(1,23): error TS2688: Cannot find type definition file for 'jest'. [ Wasp ] ../../../../node_modules/@testing-library/jest-dom/types/jest.d.ts(9,27): error TS2304: Cannot find name 'expect'....

First Time using opensaas, went through this error

[ ``` Wasp ] prisma-runtime-library.d.ts(2,26): error TS2307: Cannot find module '@prisma/client/runtime' or its corresponding type declarations. [ Wasp ] server/_types/index.ts(6,8): error TS2307: Cannot find module 'express-serve-static-core' or its corresponding type declarations. [ Wasp ] tsconfig.json(2,14): error TS6053: File '@tsconfig/node18/tsconfig.json' not found. [ Wasp ] ../../../../node_modules/@testing-library/jest-dom/types/jest.d.ts(1,23): error TS2688: Cannot find type definition file for 'jest'....

Error handling in actions

How do you safely throw an exception from an action without crashing the server but make sure to notify the client?

primitive type returns in action

Is there a way to return a string in an action? I've tried just adding it to the return statement, but typescript complains. I've also tried adding a returns: { file: File, key: string } statment to my action (I'm already returning a File entity as well). Is this even possible, or do I need to create a separate entity just to return the string?

Migration Error after Fly.io deployment

I recently upgraded wasp from 0.13 to 0.14 and on recent deploys i have encountered an error that doesnt let my server go online. Here is an extract of the error my server logs is throwing:

How to create a credit plan where I want to provide credits to multiple user features

I have app which has multiple features . So if he purchase one time credit, the credit amounts for feature 1 should increase by 10, feature 2 by 20 and feature 3 by 30. This because some feature are costly as they use dependent services and other feature we want to limit so that they don't abuse the system.

CORS error for login when google OAuth is enabled

Access to XMLHttpRequest at 'https://lecturelab-server.fly.dev/auth/me' from origin 'https://lecturelab-client.fly.dev' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. I get this error when i uncomment the google auth bit in main.wasp auth for opensaas it works in dev locally just not production...

Customer portal

ZodError: [ { "code": "invalid_type", "expected": "string", "received": "undefined",...

Wasp Railway Migrations

So my app is hosted on railway, they do not provide ssh access to their servers but I get the following error, my migration failed and when I follow the prisma link to resolve it it says to rollback the migration and fix it, how do I do that if I dont have access to the server? https://www.prisma.io/docs/orm/prisma-migrate/workflows/patching-and-hotfixing#failed-migration...
No description

Problem with cors out of no where

login:25 Uncaught SyntaxError: Unexpected end of input (at login:25:41)Understand this error login:1 Access to XMLHttpRequest at 'https://lecturelab-server.fly.dev/auth/me' from origin 'https://lecturelab-client.fly.dev' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.Understand this error index-BZgIB584.js:57
...

Unknown at rule @tailwindcss(unknownAtRules)

I got this error and im trying to apply the Satoshi font and also getting some styles from Main.css but its no working, i can get the theme config from tailwind.config but not the rules from Main.css file. Im using opensass templante....
No description

OpenSaas setting up teams?

Can anyone tell me how difficult it is to set up teams and team subscriptions with the OpenSaaS template?

How do I create a page to display a single Task?

Taking the example 'todo' app as an example. How do I create a page to show a single Task? I've given it a go but I've hit a dead end! Using the example from https://wasp-lang.dev/docs/tutorial/pages I have the following but have no idea how to use RouteComponentProps. In main.wasp I have: ```...

Is it good practice to call an action in a job in wasp?

I have several processes in my app that normally run on cron jobs, but sometimes I want to click a button to run them manually via an admin dashboard (both for testing and for their actual functionality). Is it good practice to just create an action, and call it both from the front end and in a job?

Blog Questions

How do I change the style of the blog in opensaas?

client not working when visit port 3000

Hello all! Just learning NextJS, coming from Astro. Decided to give this stack a shot based on research and all the features. I got Docker running on a Ubuntu VPS. After running “wasp start” everything starts fine. When I visit my IP:3000, it’s just a blank page that does not load and I get connection timed out. Any ideas?

How can I display the user's credits on the navbar ?

How can I display the user's credits on the navbar with open saas template ?

Problems with operations

I am trying to set up a simple crm foundation. I have added the schema entries and updated schema, i have added the routing and queries/actions to the wasp file, making sure to use the proper pathing - "@src/crm/operations" and routing: route CRMRoute { path: "/crm", to: CRMPage }...