-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into fix/next/build-output-formatAmpMessages-wi…
…thout-message
- Loading branch information
Showing
485 changed files
with
6,156 additions
and
2,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Cannot output to /public | ||
|
||
#### Why This Error Occurred | ||
|
||
Either you set `distDir` to `public` in your `next.config.js` or during `next export` you tried to export to the `public` directory. | ||
|
||
This is not allowed due to `public` being a special folder in Next.js used to serve static assets. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Use a different `distDir` or export to a different folder. | ||
|
||
### Useful Links | ||
|
||
- [Static file serving docs](https://nextjs.org/docs#static-file-serving-eg-images) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Global CSS Must Be in Your Custom <App> | ||
|
||
#### Why This Error Occurred | ||
|
||
An attempt to import Global CSS from a file other than `pages/_app.js` was made. | ||
|
||
Global CSS cannot be used in files other than your Custom `<App>` due to its side-effects and ordering problems. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Relocate all Global CSS imports to your `pages/_app.js` file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# No Cache Detected | ||
|
||
#### Why This Error Occurred | ||
|
||
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. | ||
|
||
#### 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. | ||
> However, you'll want to make sure it doesn't continue to happen and fix it if it does! | ||
Configure Next.js' cache to be persisted across builds. Next.js stores its cache in the `.next/cache` directory. | ||
|
||
Storing this folder across builds varies by CI provider. We've provided a list of a few common providers below. | ||
|
||
**ZEIT Now** | ||
|
||
Next.js caching is automatically configured for you. There's no action required on your part. | ||
|
||
**CircleCI** | ||
|
||
Edit your `save_cache` step in `.circleci/config.yml` to include `.next/cache`: | ||
|
||
```yaml | ||
steps: | ||
- save_cache: | ||
key: dependency-cache-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ./node_modules | ||
- ./.next/cache | ||
``` | ||
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** | ||
|
||
Add or merge the following into your `.travis.yml`: | ||
|
||
```yaml | ||
cache: | ||
directories: | ||
- $HOME/.cache/yarn | ||
- node_modules | ||
- .next/cache | ||
``` | ||
|
||
**GitLab CI** | ||
|
||
Add or merge the following into your `.gitlab-ci.yml`: | ||
|
||
```yaml | ||
cache: | ||
key: ${CI_COMMIT_REF_SLUG} | ||
paths: | ||
- node_modules/ | ||
- .next/cache/ | ||
``` | ||
|
||
**Netlify CI** | ||
|
||
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. | ||
|
||
**AWS CodeBuild** | ||
|
||
Add (or merge in) the following to your `buildspec.yml`: | ||
|
||
```yaml | ||
cache: | ||
paths: | ||
- 'node_modules/**/*' # Cache `node_modules` for faster `yarn` or `npm i` | ||
- '.next/cache/**/*' # Cache Next.js for faster application rebuilds | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Opt-out of Automatic Static Optimization | ||
|
||
#### Why This Warning Occurred | ||
|
||
You are using `getInitialProps` in your [Custom `<App>`](https://nextjs.org/docs#custom-app). | ||
|
||
This causes **all pages** to be executed on the server -- disabling [Automatic Static Optimization](https://nextjs.org/docs#automatic-static-optimization). | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Be sure you meant to use `getInitialProps` in `pages/_app`! | ||
There are some valid use cases for this, but it is often better to handle `getInitialProps` on a _per-page_ basis. | ||
|
||
If you previously copied the [Custom `<App>`](https://nextjs.org/docs#custom-app) example, you may be able to remove your `getInitialProps`. | ||
|
||
The following `getInitialProps` does nothing and may be removed: | ||
|
||
```js | ||
class MyApp extends App { | ||
// Remove me, I do nothing! | ||
static async getInitialProps({ Component, ctx }) { | ||
let pageProps = {} | ||
|
||
if (Component.getInitialProps) { | ||
pageProps = await Component.getInitialProps(ctx) | ||
} | ||
|
||
return { pageProps } | ||
} | ||
|
||
render() { | ||
// ... | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Static directory is deprecated | ||
|
||
#### Why This Error Occurred | ||
|
||
In versions prior to 9.0.6 the `static` directory was used to serve static assets in a Next.js application. This has been deprecated in favor of a `public` directory. | ||
|
||
The reason we want to support a `public` directory instead is to not require the `/static` prefix for assets anymore and there is no reason to maintain both paths. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
You can move your `static` directory inside of the `public` directory and all URLs will remain the same as they were before. | ||
|
||
**Before** | ||
|
||
```sh | ||
static/ | ||
my-image.jpg | ||
pages/ | ||
index.js | ||
components/ | ||
my-image.js | ||
``` | ||
|
||
**After** | ||
|
||
```sh | ||
public/ | ||
static/ | ||
my-image.jpg | ||
pages/ | ||
index.js | ||
components/ | ||
my-image.js | ||
``` | ||
|
||
### Useful Links | ||
|
||
- [Static file serving docs](https://nextjs.org/docs#static-file-serving-eg-images) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
.next | ||
node_modules |
Oops, something went wrong.