Skip to content

Netlify & Vercel caching guides#4668

Merged
ruheni merged 4 commits into
mainfrom
vercel-netlify-caching-docs
Apr 18, 2023
Merged

Netlify & Vercel caching guides#4668
ruheni merged 4 commits into
mainfrom
vercel-netlify-caching-docs

Conversation

@sabinadams
Copy link
Copy Markdown
Contributor

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2023 1:58pm

@sabinadams sabinadams self-assigned this Apr 17, 2023
@sabinadams sabinadams requested review from janpio and millsp April 17, 2023 04:41
@github-actions
Copy link
Copy Markdown
Contributor

This PR probably requires the following redirects to be added to vercel.json:

  • This PR does not change any pages in a way that would require a redirect.

@millsp
Copy link
Copy Markdown
Contributor

millsp commented Apr 17, 2023

Links to add before merge
prisma/pris.ly#96


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>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more words as context what is hiding here:

Suggested change
<details><summary>Prisma Client versions below 4.13.0</summary>
<details><summary>Situation for Prisma Client versions below 4.13.0</summary>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Comment on lines +59 to +69
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"
}
...
}
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 `&&`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence could add something of the for "npx prisma generate && ", similar to other sections.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Comment on lines +73 to +79
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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Copy link
Copy Markdown
Contributor

@janpio janpio Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an important one - I think the current state is completely wrong and does not work. We should start here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggested changes above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Comment on lines +59 to +69
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"
}
...
}
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestions above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Comment on lines +73 to +83
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>"
}
...
}
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: look into this after the release

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Co-authored-by: pierre <pierreantoine.urvoy@gmail.com>
@ruheni ruheni merged commit 26b0243 into main Apr 18, 2023
@ruheni ruheni deleted the vercel-netlify-caching-docs branch April 18, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy on Vercel: add instructions to explicitly run npx prisma generate on Vercel.

4 participants