[BUG] - Admin Panel Not Reflecting Prisma Schema Updates After Deploy on Vercel
Description
Hi everyone, how are you doing? I'm facing an issue, and I'm not sure if it's directly related to the framework or Vercel. When I update the schema in Prisma, for example, by adding a new model, after deploying to Vercel, the admin panel doesn’t reflect the changes. To make it work, I have to delete the app on Vercel and recreate it from scratch. In other words, it only detects the changes from the first deploy.
Does anyone have any idea why this might be happening or how to fix it? Thanks in advance!
Reproduction URL
https://github.com/setcubillos/web.rtms
Reproduction steps
1. Update the schema on prisma
2. deploy de app to vercel
3. Observe that the Admin panel not display the changes
4. When ad a new model the Menu not display the new model(only on Prod)
Next router
App router
Next Admin version
7.0.1
Screenshots
![DESCRIPTION]()
Next Admin options
No response
Logs
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at <unknown> (/var/task/.next/server/chunks/47.js:1:700)
at Array.map (<anonymous>)
at <unknown> (/var/task/.next/server/chunks/47.js:1:671)
at r (/var/task/.next/server/chunks/47.js:1:884)
at k (/var/task/.next/server/app/admin/[[...nextadmin]]/page.js:14:205428)
at ek (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:84:13409)
at e (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:84:17307)
at eO (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:84:17769)
at eO (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:84:17944) {
digest: '1238321692'
}
Browsers
Chrome
Description I encountered an issue when adding a new property, ranking, to the Involvement model. After updating the schema, I also included this property in my options file.
Here is an example of the update:
The changes work perfectly in the local environment. However, in the production environment, the property does not seem to work as expected. Interestingly, if I comment out the line where the property is used, everything works fine in production.
Steps to Reproduce Add a new property (ranking) to the Involvement model. Update the options file to include the new property. Deploy the changes to the production environment.
Actual Behavior Locally: The changes work without issues. Production: The application does not function as expected unless the new property (ranking) is commented out. Additional Information The issue only arises in the production environment, not locally.
Hello @setcubillos ,
When you deploy to Vercel, are you running a script that pushes your schema to your database ? Through prisma db push or prisma db migrate
@setcubillos This is the script that are using
Can you see the new columns in your database ?
In the example app we are doing this in the vercel-build script
Yes, the database is updated contains the new field, but the option file not reconize the new property added,
As mentioned before if comment this line then working
Thanks for the details, we will have a look
Hi @foyarash Just to let you know, I downgraded to version 6.1.8, to use the JSON schema generator and worked!
Thanks for this, guess we have an issue with the new generator then, we will investigate
Hey @setcubillos
Sorry for the delay, I come back to this issue, do you still have the issue ?