You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error - ColumnTypeUndefinedError: Column type for AccountEntity#type is not defined and cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true option in tsconfig.json. Also make sure you have imported "reflect-metadata" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.
...
import*asentitiesfrom'@/lib/entity/nextauth-entities';// my local copy of 'entities.ts'
...
exportdefaultNextAuth({// Use the database to persist user, and session infoadapter: TypeORMLegacyAdapter(connection),// , { entities }),
The next-auth default works, creates DB tables and so on, and my local copy complains of a type error. After searching, I was not able to find any leads, or at least things I haven't tried. Perhaps the instructions are missing some crucial detail? Please advise.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First of great product and kudos to the development team!
Following the instructions here: https://next-auth.js.org/adapters/typeorm#custom-models to define typeOrm entities in my own package, I find that I get the error:
however if I comment out
[...nextauth].ts
file so that the default next-auth entites are used it all works fine. In my local project I am using a copy of https://github.com/nextauthjs/adapters/blob/next/packages/typeorm-legacy/src/entities.ts to get started, so it should be the same as what is working by default.The next-auth default works, creates DB tables and so on, and my local copy complains of a type error. After searching, I was not able to find any leads, or at least things I haven't tried. Perhaps the instructions are missing some crucial detail? Please advise.
Beta Was this translation helpful? Give feedback.
All reactions