Query returns empty in production Next.js
export const getLines = query({
args: {
document_id: v.id("documents"),
},
handler: async (ctx, args) => {
const lines = await ctx.db
.query("lines")
.withIndex("by_document_id", (q) => q.eq("document_id", args.document_id))
.collect();
return lines;
},
});
const data = await preloadQuery(api.lines.getLines, {
document_id: id as Id<"documents">,
});
const preloadedLines = usePreloadedQuery(lines);This works perfect on local development, but on production returns empty even if there are documents on the table (even after refresh).
This does not happens all the time, there are times when the query is not empty. I would say 70/30 being empty 70%.
