Wasp-lang

W

Wasp-lang

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

Join

Importing a json module

Hello again! One other minor issue I encountered: how can I import a JSON module (import { something } from "./somewhere/my.json";) ? I followed some TS tutorial and enabled esModuleInterop and resolveJsonModule compilerOptions in tsconfig.json but I get a build error in [ Wasp ] TS2732 cannot find module … consider using --resolveJsonModule...

Form Styling

I am having trouble finding the appropriate form template to style so that it looks more like my preferred colors. I tried using keywords, checking the whole client folder, exploring other folders, components, and form pages. All I am seeing is the SignupPage importing SignupForm but I cannot locate said form to change its styles. I tried altering FormLayout component to no avail. How do we change the forms?

ngrok...

Thought would be cool to share the app with a colleague using ngrok. Its breaking because auth/me on 3001 XMLHttpRequest cannot load http://localhost:3001/auth/me due to access control checks. ngrok http http://localhost:3000 ...

email template support

If I’m using mailgun as the mail provider, Is it possible to pass in an email template?

My login tab on the frontpage went missing after deployment on fly.io

:sadboi: I followed the step on the documentation and all, I put all the necessary secret keys like google client id, sendgrid API, REACT_APP_VARIABLE_KEYS. I went directly to /login, the front-end of google auth login is there, but it is not working. What else am I missing?...

WebSocket authentication

Hello this is maybe a stupid question, but looking at the websocket page in the docs I couldn't determine if there is a way (or maybe it already exists by default and it's just not mentioned) to restrict websocket connections to only authenticated users?

Template Signup Network Error

Hey, I cloned the open-saas template, connected external DB, migrated and seeded it successfully. When I start the server and try to signup (username and pass), I get a Network Error and some errors in the console that I can't figure out where they are coming from Please help :sadboi:
No description

Upload files using multer

I was following this gist to setup multer for uploading files but ran into errors, then realized it may be written for the version 0.11.8. I will continue to debug. Here are the errors: [ Client!] 9:13:35 PM [vite] Internal server error: Failed to resolve import "@wasp/api" from "../../../src/UploadPage.jsx". Does the file exist? ...

.wasp not recognising disambiguating relations

I have tried to define one-to-many relation between entities User and PurchaseRequest. Here is schema: `entity User {=psl /// purchaseRequestsCreated PurchaseRequest[] @relation(name: "createdBy")...

How to test delete function in open sass starter template

Hello I am new to wasp and im trying to figure out how to properly unit test the front end. I have an initial test that is passing, that tests the getAllTasksByUser query returns the tasks and renders to the front end. My failing test is supposed to follow a similar format as the first. Mock the function to return the expected data but im having trouble with a typescript error when passing in deleteTask to mockQuery -> "Argument of type 'Promise<GetResult<{ id: string; description: string; time: string; isDone: boolean; userId: number; createdAt: Date; }, unknown> & {}>' is not assignable to parameter of type 'Query<unknown, unknown>'. Type 'Promise<GetResult<{ id: string; description: string; time: string; isDone: boolean; userId: number; createdAt: Date; }, unknown> & {}>' provides no match for the signature '(queryCacheKey: string[], args: unknown): Promise<unknown>'.ts(2345)"...
No description

How to test the backend in isolation

how do you isolate and unit test the backend code, and also is there a way to view the payload of these backend opertaions without connecting to the client ( like maybe some kind of API so i can just check the json and interact with it via postman?!? )

Whenever I run `wasp db migrate-dev` on my ec2 instance (micro free tier) it causes the box to hang

the free tier only has like 1gb of memory so that could be the issue. is there anyone else whos run into this problem?

Is it possible to redirect post requests in wasp

Since there's no way to run code directly within Wasp upon signup or login, I've been trying to get around that while still keeping Wasp code untouched. I've created some custom code that I want to run on signup and I have it running on http://localhost:3002/auth/username/login. Wasp runs on port 3001 so usually the wasp request to that same endpoint would be at this link: http://localhost:3001/auth/username/login. When the post request is made to this link: http://localhost:3001/auth/username/login...

Importing external CSS

Hello, I’d like to use "flag-icons" package which one can import in normal React apps with: import "node_modules/flag-icons/css/flag-icons.min.css"; But I get errors with file not found when building with Wasp — if I try to import it with "../../…..", then it builds but there’s an error in the browser that the file can’t be accessed. What to do?...

Running database migrations on hosted app

Hey everyone! I have my app hosted on Fly. - When I try to sign up or log in, it says "Save failed: there was a database error" (see image 1). - The Fly monitoring logs state the issue quite clearly: "🐝 This error can happen if you did't run the database migrations" (see image 2). How do I go about running database migrations before I deploy a new release? I was looking at the Fly docs https://fly.io/docs/reference/configuration/#the-deploy-section, which say to add a release_command to the .toml file....
No description

Can Mage CLI review code?

Hey guys, I'm loving the WASP CLI so far. I'm wondering two things: 1. After I've generated code with WASP CLI AI and then added new code manually, is there a way to have the WASP AI re-review it and edit it? 2. This might be a dumb Q, but is it possible to use Open-SaaS template with the CLI AI? I'd love to use Open SaaS for frontend then have WASP AI create the actual app. But I feel like it could get messy...

Auth kicking out

This could be a normal behavior but feels weird. Please let me know if I can ignore. I can demo this app with Chrome and Safari so this won't happen in front of the stakeholders. I have 2 pages. Campaign page (get-campaigns) need auth. Upload page (get-campaign-by-token) does not need auth. Both pages are opened in Safari in different tabs. If I switch between tabs I am getting logged out. After writing this it sounds normal? Does it? Here is the log:...

Object relation doesn't compile to TypeScript

I have an explicit many-to-many relation that I want to display data. After migrating from version 0.11 to version 0.12, I can't find a way to display objects of my entity. Here is my schema: ` entity Material {=psl id Int @id @default(autoincrement())...

Failure to deploy client with Wasp CLI

I'm trying to deploy my app via the Wasp CLI (wasp deploy fly launch my-wasp-app mia), but the client always fails (see attached image). Only the server and db deploy successfully to Fly.io. It looks like someone made a PR with the same issue: https://github.com/wasp-lang/open-saas/issues/77...
No description

Using Cypress for end to end testing and getting a 401 error, not to sure why

I created a cypress test using cy.visit('http://localhost:3000') and im getting a 401 error. I used a sample test provided by the docs and that works
No description