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
I'm experiencing an issue with Lucid ORM in a new AdonisJS project when trying to execute a seeder that registers a user. The error occurs because Lucid cannot define the fullName property on the User model, even though it is correctly defined in both the migration and the model.
Environment:
Node.js version: 22.9.0
AdonisJS version: Latest (configured with npm init adonisjs@latest)
@adonisjs/lucid 21.3.0
Database: PostgreSQL
Operating System: Ubuntu 22.04.4 LTS
Additional setup: Project configured with Inertia.js, Vue.js, and Server-Side Rendering (SSR) enabled.
When I run the migration and then execute the seeders, I encounter the following error:
[ success ] Dropped tables successfully
[ info ] Upgrading migrations version from "1" to "2"
❯ migrated database/migrations/1728592522466_create_users_table
Migrated in 72 ms
Map(0) {}
❯ completed database/seeders/user_seeder
file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js:1289
throw new Error(`Cannot define "${key}" on "${Model.name}" model, since it is not defined as a model property`);
^
Error: Cannot define "fullName" on "User" model, since it is not defined as a model property
at file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js:1289:27
at Array.forEach (<anonymous>)
at Proxy.merge (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js:1248:33)
at User.newUpWithOptions (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js:118:13)
at User.create (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js:437:31)
at UserSeeder.run (file:///home/Gampel/Documentos/test/adonisjsTest/database/seeders/user_seeder.ts:9:14)
at SeedsRunner.run (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/src/seeders/runner.js:66:34)
at async DbSeed.executedSeeders (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/commands/db_seed.js:119:30)
at async DbSeed.runAsSubCommand (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/commands/db_seed.js:178:24)
at async DbSeed.run (file:///home/Gampel/Documentos/test/adonisjsTest/node_modules/@adonisjs/lucid/build/commands/db_seed.js:201:13)
It seems like Lucid cannot register the fullName property correctly, even though it's defined in both the migration and the model.
The text was updated successfully, but these errors were encountered:
Package version
@adonisjs/[email protected]
Describe the bug
I'm experiencing an issue with Lucid ORM in a new AdonisJS project when trying to execute a seeder that registers a user. The error occurs because Lucid cannot define the
fullName
property on theUser
model, even though it is correctly defined in both the migration and the model.Environment:
npm init adonisjs@latest
)Migration:
Model
Seeder
Error
When I run the migration and then execute the seeders, I encounter the following error:
It seems like Lucid cannot register the fullName property correctly, even though it's defined in both the migration and the model.
The text was updated successfully, but these errors were encountered: