MatG13
MatG13
Explore posts from servers
PPrisma
Created by MatG13 on 6/5/2024 in #help-and-questions
Main .prisma file location with new prismaSchemaFolder feature (+ Bazel)
I'm applying some changes by splitting the main file into smaller pieces, thanks to this new cool feature. Anyway, as we are using BAZEL and a custom generator, I need to tell BAZEL build rules file where to locate the file which has all the models, and If I keep It like It was just aiming to the schema.prisma file, It will log several errors not finding the models: (As It is taking the schema.prisma raw directly from the folder). I can't seem to find the location (If that's how It works) where a single schema.prisma file is located having all the .prisma files of /schema folder. For now I managed to make it work concatenating all files through a script but I think there should be another way Sample of error If using the main schema.prisma:
error: Type "TicketRecord" is neither a built-in type, nor refers to another model, composite type, or enum.
--> schema/schema.prisma:1427
|
1426 | Assets AssetRecord[]
1427 | ticket TicketRecord @relation(fields: [ticketId], references: [tickerId])
|
error: Type "TicketRecord" is neither a built-in type, nor refers to another model, composite type, or enum.
--> schema/schema.prisma:1480
|
1479 |
1480 | ticket TicketRecord @relation(fields: [ticketId], references: [ticketId], onUpdate: Restrict, map: "system__ticket_assets_foreign_key")
error: Type "TicketRecord" is neither a built-in type, nor refers to another model, composite type, or enum.
--> schema/schema.prisma:1427
|
1426 | Assets AssetRecord[]
1427 | ticket TicketRecord @relation(fields: [ticketId], references: [tickerId])
|
error: Type "TicketRecord" is neither a built-in type, nor refers to another model, composite type, or enum.
--> schema/schema.prisma:1480
|
1479 |
1480 | ticket TicketRecord @relation(fields: [ticketId], references: [ticketId], onUpdate: Restrict, map: "system__ticket_assets_foreign_key")
It's currently working with this bazel genrule, but It seems hard-coded as I think there might be a single file already created by prisma where all the .prisma files are combined (?)
genrule(
name = "combine_prisma_schemas",
srcs = glob(["schema/*.prisma"]),
outs = ["schema.prisma"],
cmd = """
cat $(SRCS) > $@
""",
)
genrule(
name = "combine_prisma_schemas",
srcs = glob(["schema/*.prisma"]),
outs = ["schema.prisma"],
cmd = """
cat $(SRCS) > $@
""",
)
4 replies
RRailway
Created by MatG13 on 10/24/2023 in #✋|help
Front End deploy, "Application failed to respond" Vite
Hello! I am deploying a simple app on Railway, had issues with same error when deploying back but article on Railway refering to whis error worked for me. Anyway, now I am getting this same error when deploying front. I changed vite start command with start: vite --host and have tried with start: vite --host 0.0.0.0, and as I did not found any article yet referring to this error on front-end I come here trying to solve 🙂 On deploy Logs I get this:
[email protected] start
vite --host
VITE v4.5.0 ready in 236 ms ➜ Local: http://localhost:5173/ ➜ Network: http://172.17.1.98:5173/ Proyect-ID: 15962663-323b-4e7f-882b-b3c2bdca0c35
13 replies