I can't seem to fix this error! Can you help?
What are you trying to do
I'm trying to set up just the basic email/passwordless login.
Relevant stack:
Everything right now is extremely default and working, except when I try to submit an email login. It hangs forever, giving the following in the server:
(node:58840) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.user.findOne()` invocation in
/path/to/project/node_modules/next-auth/dist/adapters/prisma/index.js:125:33
Invalid feature flag: aggregations
at PrismaClientFetcher.request (/path/to/project/node_modules/@prisma/client/runtime/index.js:1:211356)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:58840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:58840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
If I cancel the request (hit the X in the browser) it adds:
Error! Failed to complete request to /api/auth/signin/email: Error: socket hang up
// pages/api/auth/[...next-auth].js
import NextAuth from 'next-auth';
import Providers from 'next-auth/providers';
import Adapters from 'next-auth/adapters';
import { PrismaClient } from '@prisma/client';
// I've tried with and without this, as per the docs
let prisma;
if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient();
} else {
if (!global.prisma) {
global.prisma = new PrismaClient();
}
prisma = global.prisma;
}
const options = {
providers: [
Providers.Email({
server: process.env.EMAIL_SERVER,
from: process.env.EMAIL_FROM,
}),
],
adapter: Adapters.Prisma.Adapter({ prisma }),
}
export default (req, res) => NextAuth(req, res, options)
Feedback
@nickisnoble your issues seems to be related to Prisma. Ensure you running the latest.
Hint: https://community.redwoodjs.com/t/redwoodjs-v0-13-0-has-been-released/874
@nickisnoble were you able to fix this?
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep ot open. Thanks!
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks!
Most helpful comment
@nickisnoble your issues seems to be related to Prisma. Ensure you running the latest.
Hint: https://community.redwoodjs.com/t/redwoodjs-v0-13-0-has-been-released/874