Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using the Vite dev server, client side navigations are inexplicably failing when trying to navigate to a page which imports (either directly or indirectly) any schema values from
@trigger.dev/database
and uses them for actual code. Importing and using them as types seems to be ok, and importing the prisma package also works.I've tested using prisma-zod-types and importing those results instead, with the same issue.
On occasion I can get it to show an error message, which looks like
@trigger.dev/database does not provide an export TaskRunStatus
as if the prisma client hadn't been generated. However VS Code can resolve the types fine, and it works on SSR as well. I'm not sure if this error is at the pnpm layer or with Vite directly, or possibly part of the way it optimizes dependencies doesn't work with prisma's codegen over pnpm's symlinks. Lots of moving parts here.This PR unblocks the process by finding every place in the webapp where the prisma client is used at runtime and inlining the values. There's a fair bit of duplication here because I kept each one to its own file. We could find a real home for these but I'd consider this a temporary solution at the moment until Vite gets sorted out.
Closes #
✅ Checklist
Testing
[Describe the steps you took to test this change]
Changelog
[Short description of what has changed]
Screenshots
[Screenshots]
💯