A Next.js build was triggered in a continuous integration environment, but no cache was detected.
A Next.js build was triggered in a continuous integration environment, but no cache was detected.
This results in slower builds and can hurt Next.js' persistent caching of client-side bundles across builds.
This results in slower builds and can hurt Next.js' persistent caching of client-side bundles across builds.
#### Possible Ways to Fix It
### Possible Ways to Fix It
> **Note**: If this is a new project, or being built for the first time in your CI, you can ignore this error.
> **Note**: If this is a new project, or being built for the first time in your CI, you can ignore this error.
> However, you'll want to make sure it doesn't continue to happen and fix it if it does!
> However, you'll want to make sure it doesn't continue to happen and fix it if it does!
...
@@ -15,11 +15,11 @@ Configure Next.js' cache to be persisted across builds. Next.js stores its cache
...
@@ -15,11 +15,11 @@ Configure Next.js' cache to be persisted across builds. Next.js stores its cache
Storing this folder across builds varies by CI provider. We've provided a list of a few common providers below.
Storing this folder across builds varies by CI provider. We've provided a list of a few common providers below.
**ZEIT Now**
#### ZEIT Now
Next.js caching is automatically configured for you. There's no action required on your part.
Next.js caching is automatically configured for you. There's no action required on your part.
**CircleCI**
#### CircleCI
Edit your `save_cache` step in `.circleci/config.yml` to include `.next/cache`:
Edit your `save_cache` step in `.circleci/config.yml` to include `.next/cache`:
...
@@ -34,7 +34,7 @@ steps:
...
@@ -34,7 +34,7 @@ steps:
If you do not have a `save_cache` key, please follow CircleCI's [documentation on setting up build caching](https://circleci.com/docs/2.0/caching/).
If you do not have a `save_cache` key, please follow CircleCI's [documentation on setting up build caching](https://circleci.com/docs/2.0/caching/).
**Travis CI**
#### Travis CI
Add or merge the following into your `.travis.yml`:
Add or merge the following into your `.travis.yml`:
...
@@ -46,7 +46,7 @@ cache:
...
@@ -46,7 +46,7 @@ cache:
-.next/cache
-.next/cache
```
```
**GitLab CI**
#### GitLab CI
Add or merge the following into your `.gitlab-ci.yml`:
Add or merge the following into your `.gitlab-ci.yml`:
...
@@ -58,13 +58,13 @@ cache:
...
@@ -58,13 +58,13 @@ cache:
-.next/cache/
-.next/cache/
```
```
**Netlify CI**
#### Netlify CI
It is **not possible** to cache custom build files on Netlify. Please contact their support and request they support this behavior.
It is **not possible** to cache custom build files on Netlify. Please contact their support and request they support this behavior.
You can investigate using a 3rd party solution (e.g. [`cache-me-outside`](https://github.com/DavidWells/cache-me-outside)) to manually cache the Next.js output.
You can investigate using a 3rd party solution (e.g. [`cache-me-outside`](https://github.com/DavidWells/cache-me-outside)) to manually cache the Next.js output.
**AWS CodeBuild**
#### AWS CodeBuild
Add (or merge in) the following to your `buildspec.yml`:
Add (or merge in) the following to your `buildspec.yml`:
...
@@ -75,7 +75,7 @@ cache:
...
@@ -75,7 +75,7 @@ cache:
-'.next/cache/**/*'# Cache Next.js for faster application rebuilds
-'.next/cache/**/*'# Cache Next.js for faster application rebuilds
```
```
**GitHub Actions**
#### GitHub Actions
Using GitHub's [actions/cache](https://github.com/actions/cache), add the following step in your workflow file:
Using GitHub's [actions/cache](https://github.com/actions/cache), add the following step in your workflow file: