17 Replies
@igor9silva what's your schema look like? It'll be easier to debug if you can share your code as code instead of screenshots.
That
...taskEventTable
line looks wrong but I can't see what's around itofc, sorry
thats the whole table definition (the last
union
)
on the same file works fine
if I just move them to another file (any file inside convex/) and import in schema.ts
, it breaks
tried both by calling defineTable(taskEventSchema)
inside defineSchema()
or in the 2nd fileWhat does convex/schema.ts look like?
one sec
i'm doing #regions like in the good old days 😅
any insights?
Can you share more of the code? What errors are you getting?
I don't see any issues here.
You might try starting small, and building up your schema piece by piece until you don't get the error.
Are there any type errors, are you using TypeScript?
this one https://discord.com/channels/1019350475847499849/1019350478817079338/1309591914676224021
I can't get past that
@igor9silva are you still stuck on this, could you share your code? frustrating that there's not a better error here, maybe we can improve this
Do you have any type errors? Are you using TypeScript?
hi, yes
GitHub
GitHub - get-convex/convex-tanstack-start
Contribute to get-convex/convex-tanstack-start development by creating an account on GitHub.
I do use typescript, but no type error
this is the full log
I had
taskEventSchema
declared in schema.ts
and working as expectedbut if I move it to a different file, it breaks with the above error only (no extra info)
sounds like it could be circular imports, are you importing something from schema.ts into another file?
bingo!!!
thank you so much @ballingt
I was exporting authorSchema from
schema.ts
and importing it in the 2nd file (which was naturally imported in schema.ts
)
a proper error message would be nice ofc
also updated everything to use Zod and it looks fantastic now, I'm truly hyped with ConvexWe've been kicking around the idea of a Convex-specific linter, but this is a general thing you can use something like https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md#importno-cycle for. We probably can't make it an error like https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md does because it's a common structure and hard to statically detect when it works