Closed Jaxenormus closed 2 years ago
On blitz version 0.40.0-canary.7 ctx.session is undefined when hosted on vercel, I haven't tested an earlier version
0.40.0-canary.7
2021-08-30 23:03:43.310 INFO signup() Starting with input: { name: 'Caleb', email: 'test@test.com', password: '[***]', betaInvite: '9D6F7DFE-FCB6-45CD-8C29-3AB2796A20F3' } 2021-08-30 23:03:44.367 ERROR signup() TypeError Cannot read property '$create' of undefined error stack: • signup.js:161 <anonymous> .next/serverless/pages/api/rpc/signup.js:161:21 • blitzjs-core-server.cjs.prod.js:22 <anonymous> node_modules/@blitzjs/core/server/dist/blitzjs-core-server.cjs.prod.js:22:20 • api-utils.js:164 <anonymous> node_modules/next/dist/server/api-utils.js:164:32 • middleware.js:39 handleRequestWithMiddleware node_modules/next/dist/server/middleware.js:39:9 • api-utils.js:112 apiResolver node_modules/next/dist/server/api-utils.js:112:13 • 8277.js:40 <anonymous> .next/serverless/chunks/8277.js:40:13
await ctx.session.$create({ userId: user.id, role: Role.USER })
blitz -v
PASTE_HERE (leave the ``` marks)
No response
Fixed in https://github.com/blitz-js/blitz/pull/2730
What is the problem?
On blitz version
0.40.0-canary.7
ctx.session is undefined when hosted on vercel, I haven't tested an earlier versionPaste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response