Netlify & Vercel caching guides#4668
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This PR changes the following pages (Vercel Preview Deploy links): Changed Vercel links
(Note that links will only be valid after Vercel preview deploy succeeded) |
|
This PR probably requires the following redirects to be added to vercel.json:
|
|
Links to add before merge |
|
|
||
| This error message prevents this situation from happening and directs you here to learn how to fix the root issue. | ||
|
|
||
| <details><summary>Prisma Client versions below 4.13.0</summary> |
There was a problem hiding this comment.
A bit more words as context what is hiding here:
| <details><summary>Prisma Client versions below 4.13.0</summary> | |
| <details><summary>Situation for Prisma Client versions below 4.13.0</summary> |
There was a problem hiding this comment.
TODO: look into this after the release
| Within the `scripts` section of your project's `package.json` file, if there is not already a script named `postinstall`, add one and add `npx prisma generate` to that script: | ||
|
|
||
| ```json highlight=4;add | ||
| { | ||
| ... | ||
| "scripts" { | ||
| "postinstall": "npx prisma generate" | ||
| } | ||
| ... | ||
| } | ||
| ``` |
There was a problem hiding this comment.
| Within the `scripts` section of your project's `package.json` file, if there is not already a script named `postinstall`, add one and add `npx prisma generate` to that script: | |
| ```json highlight=4;add | |
| { | |
| ... | |
| "scripts" { | |
| "postinstall": "npx prisma generate" | |
| } | |
| ... | |
| } | |
| ``` | |
| Within the `scripts` section of your project's `package.json` file, add a script named `postinstall` and define it to configure the command `npx prisma generate`: | |
| ```json highlight=4;add | |
| { | |
| ... | |
| "scripts" { | |
| "postinstall": "npx prisma generate" | |
| } | |
| ... | |
| } | |
| ``` | |
| If your project already has a `postinstall` npm script, add the command to the commands to be run with `&&`. |
There was a problem hiding this comment.
I think this sentence could add something of the for "npx prisma generate && ", similar to other sections.
There was a problem hiding this comment.
TODO: look into this after the release
| Within the `scripts` section of your project's `package.json` file, within the `build` script, prepend `npx prisma generate` to the default `vercel build` command: | ||
|
|
||
| ```json highlight=4;add | ||
| { | ||
| ... | ||
| "scripts" { | ||
| "build": "npx prisma generate && vercel build" |
There was a problem hiding this comment.
Huh? Wouldn't that require the Vercel CLI to be installed?
I think it has to be the "default build command of your project (e.g. next build when you are using Next.js)" or something like that. vercel build is something different I think.
There was a problem hiding this comment.
TODO: look into this after the release
There was a problem hiding this comment.
This is an important one - I think the current state is completely wrong and does not work. We should start here.
There was a problem hiding this comment.
Confirmed, vercel build would require the Vercel CLI installed which is unlikely to work locally if a user hasn't installed it.
I've made the update in #4677
|
|
||
| This error message prevents this situation from happening and directs you here to learn how to fix the root issue. | ||
|
|
||
| <details><summary>Prisma Client versions below 4.13.0</summary> |
There was a problem hiding this comment.
See suggested changes above
There was a problem hiding this comment.
TODO: look into this after the release
| Within the `scripts` section of your project's `package.json` file, if there is not already a script named `postinstall`, add one and add `npx prisma generate` in that script: | ||
|
|
||
| ```json highlight=4;add | ||
| { | ||
| ... | ||
| "scripts" { | ||
| "postinstall": "npx prisma generate" | ||
| } | ||
| ... | ||
| } | ||
| ``` |
There was a problem hiding this comment.
TODO: look into this after the release
| Within the `scripts` section of your project's `package.json` file, within the `build` script, prepend `npx prisma generate` to the existing build command: | ||
|
|
||
| ```json highlight=4;add | ||
| { | ||
| ... | ||
| "scripts" { | ||
| "build": "npx prisma generate && <actual-build-command>" | ||
| } | ||
| ... | ||
| } | ||
| ``` |
There was a problem hiding this comment.
I think this looks better than the Vercel suggestion.
(Still could use the concrete Next.js example as that will often be what is actually needed)
There was a problem hiding this comment.
TODO: look into this after the release
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> Co-authored-by: pierre <pierreantoine.urvoy@gmail.com>
Describe this PR
Adds two troubleshooting guides that walk users through configuring their project to fix the caching issues related to Vercel & Netlify.
Closes #3590