I got an error using Next Auth with Prisma Adapter on create-t3-app. I successfully added data on my Planetscale database.
I got this error when I try to log in using Next Auth Google Provider. There is also Discord Provider which I can log in and create an account as well as a User linked to the account. I cannot create an account using Google due to the error below.
prisma:query BEGIN
prisma:query INSERT INTO `foo`.`Account` (`id`,`userId`,`type`,`provider`,`providerAccountId`,`access_token`,`expires_at`,`token_type`,`scope`,`id_token`) VALUES (?,?,?,?,?,?,?,?,?,?)
prisma:query ROLLBACK
prisma:error
Invalid `p.account.create()` invocation in
~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42
16 },
17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),
18 deleteUser: (id) => p.user.delete({ where: { id } }),
→ 19 linkAccount: (data) => p.account.create(
The provided value for the column is too long for the column's type. Column: for
[next-auth][error][adapter_error_linkAccount]
https://next-auth.js.org/errors#adapter_error_linkaccount
Invalid `p.account.create()` invocation in
~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42
16 },
17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),
18 deleteUser: (id) => p.user.delete({ where: { id } }),
→ 19 linkAccount: (data) => p.account.create(
The provided value for the column is too long for the column's type. Column: for {
message: '\n' +
'Invalid `p.account.create()` invocation in\n' +
'~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42\n' +
'\n' +
' 16 },\n' +
' 17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),\n' +
' 18 deleteUser: (id) => p.user.delete({ where: { id } }),\n' +
'→ 19 linkAccount: (data) => p.account.create(\n' +
"The provided value for the column is too long for the column's type. Column: for",
stack: 'Error: \n' +
'Invalid `p.account.create()` invocation in\n' +
'~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42\n' +
'\n' +
' 16 },\n' +
' 17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),\n' +
' 18 deleteUser: (id) => p.user.delete({ where: { id } }),\n' +
'→ 19 linkAccount: (data) => p.account.create(\n' +
"The provided value for the column is too long for the column's type. Column: for\n" +
' at fn.handleRequestError (~/node_modules/@prisma/client/runtime/library.js:174:6477)\n' +
' at fn.handleAndLogRequestError (~/node_modules/@prisma/client/runtime/library.js:174:5907)\n' +
' at fn.request (~/node_modules/@prisma/client/runtime/library.js:174:5786)\n' +
' at async t._request (~/node_modules/@prisma/client/runtime/library.js:177:10477)',
name: 'Error'
}
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error
Invalid `p.account.create()` invocation in
~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42
16 },
17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),
18 deleteUser: (id) => p.user.delete({ where: { id } }),
→ 19 linkAccount: (data) => p.account.create(
The provided value for the column is too long for the column's type. Column: for Error:
Invalid `p.account.create()` invocation in
~/node_modules/@next-auth/prisma-adapter/dist/index.js:19:42
16 },
17 updateUser: ({ id, ...data }) => p.user.update({ where: { id }, data }),
18 deleteUser: (id) => p.user.delete({ where: { id } }),
→ 19 linkAccount: (data) => p.account.create(
The provided value for the column is too long for the column's type. Column: for
at fn.handleRequestError (~/node_modules/@prisma/client/runtime/library.js:174:6477)
at fn.handleAndLogRequestError (~/node_modules/@prisma/client/runtime/library.js:174:5907)
at fn.request (~/node_modules/@prisma/client/runtime/library.js:174:5786)
at async t._request (~/node_modules/@prisma/client/runtime/library.js:177:10477) {
name: 'LinkAccountError',
code: 'P2000'
}