tom
tom
WWasp-lang
Created by fustuk. on 9/16/2024 in #🙋questions
Backend public?
Thank you @miho , now it is working and I have no type error 🙂
57 replies
WWasp-lang
Created by fustuk. on 9/16/2024 in #🙋questions
Backend public?
No description
57 replies
WWasp-lang
Created by fustuk. on 9/16/2024 in #🙋questions
Backend public?
SOLVED: This code from another discussion solved my problem https://discord.com/channels/686873244791210014/1297928864319799337/1297938317165461545 // main.wasp app todoApp { // ... server: { middlewareConfigFn: import { serverMiddlewareFn } from "@src/serverSetup" }, } // src/serverSetup.js import cors from 'cors' export const serverMiddlewareFn = (middlewareConfig) => { // Example of adding extra domains to CORS. middlewareConfig.set('cors', cors({ origin: '*' })) return middlewareConfig }
57 replies
WWasp-lang
Created by fustuk. on 9/16/2024 in #🙋questions
Backend public?
Also I had to add a line with export default serverMiddlewareFn import cors from 'cors' import { config, type MiddlewareConfigFn } from 'wasp/server' export const serverMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => { // Example of adding an extra domains to CORS. middlewareConfig.set('cors', cors({ origin: [config.frontendUrl, 'https://example1.com', 'https://example2.com'] })) return middlewareConfig } export default serverMiddlewareFn Otherwise i get this error [ Server!] [!] RollupError: src/server.ts (6:7): "default" is not exported by "../../../src/serverSetup.ts", imported by "src/server.ts". [ Server!] https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module [ Server!] src/server.ts (6:7) [ Server!] 4: import { config } from 'wasp/server' [ Server!] 5: [ Server!] 6: import setup from '../../../../src/serverSetup' [ Server!] ^ [ Server!] 7: import { ServerSetupFn } from 'wasp/server' [ Server!] 8: import { ServerSetupFnContext } from 'wasp/server/types'
57 replies
WWasp-lang
Created by fustuk. on 9/16/2024 in #🙋questions
Backend public?
Hello, I am using this settings but i have server error [ Server!] TypeError: middlewareConfig.set is not a function [ Server!] at setup (/**/my-project/app/src/serverSetup.ts:6:20) Do you have any idea how can i fix it?
57 replies
WWasp-lang
Created by tom on 10/15/2024 in #🙋questions
Problem with generating Entity from Prisma Model.
đź‘Ť I found the solution.. There is a different schema.prisma file. My bad.
8 replies
WWasp-lang
Created by tom on 10/15/2024 in #🙋questions
Problem with generating Entity from Prisma Model.
I think that the model aproach is correct, I am not adding the entity into wasp file, just model to prisma schema. But the entity is not generated when i do the db migrate
8 replies
WWasp-lang
Created by tom on 10/15/2024 in #🙋questions
Problem with generating Entity from Prisma Model.
When i add the entity to the wasp file i have this error now my-project/app/main.wasp @ 349:1 - 353:5 Validation error: Entities can no longer be defined in the .wasp file. You should migrate your entities to the schema.prisma file. Read more: https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14#migrate-to-the-new-schemaprisma-file 348 | 349 | entity Rocket {=psl
350 | id Int @id @default(autoincrement())
351 | description String
352 | isDone Boolean @default(false)
353 | psl=}
8 replies