Open jan-wilhelm opened 3 years ago
Hmm that's weird! Are you using auth example on main
or canary
branch? Because main
branch is mega old and not currently used.
The first step for anyone who wants to look into this is add a new prisma
integration test in https://github.com/blitz-js/blitz/tree/canary/test/integration (can copy the auth integration test and modify). Then make a test to reproduce this issue.
The only thing I can think that might remotely cause this is our compilation of blitz.config.ts via esbuild
yes, sorry I meant the canary branch, not main.
What is the problem?
When importing the
@prisma/client
package inblitz.config.ts
(or when importing any file inblitz.config.ts
that itself recursively references an import to@prisma/client
anywhere in its dependency tree), any incoming request to Blitz fails with aCSRFTokenMismatchError
in production mode.For example, simply cloning and running the "auth" example from the current
canary
branch examples folder you get the exact same error when simply runningyarn build && yarn start
.Paste all your error logs here:
Paste all relevant code snippets here:
Code taken from
examples/auth/blitz.config.ts
What are detailed steps to reproduce this?
yarn prisma migrate dev
yarn build && yarn start
localhost:3000
(just to make sure: Do that in incognito mode, so that all cookies are cleared)Run
blitz -v
and paste the output here:Output from running
blitz -v
in the auth example folderPlease include below any other applicable logs and screenshots that show your problem:
No response