Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Admin Panel Not Reflecting Prisma Schema Updates After Deploy on Vercel #490

Open
setcubillos opened this issue Nov 28, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@setcubillos
Copy link

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!

2024-11-28_11-12-34 (1)

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

@setcubillos setcubillos added the bug Something isn't working label Nov 28, 2024
@setcubillos
Copy link
Author

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:
image

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.

@foyarash
Copy link
Collaborator

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
Copy link
Author

@setcubillos This is the script that are using
image

@foyarash
Copy link
Collaborator

Can you see the new columns in your database ?

In the example app we are doing this in the vercel-build script

@setcubillos
Copy link
Author

Yes, the database is updated contains the new field, but the option file not reconize the new property added,
image
As mentioned before if comment this line then working

@foyarash
Copy link
Collaborator

Thanks for the details, we will have a look

@setcubillos
Copy link
Author

Hi @foyarash Just to let you know, I downgraded to version 6.1.8, to use the JSON schema generator and worked!
image

@foyarash
Copy link
Collaborator

Thanks for this, guess we have an issue with the new generator then, we will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants