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

Update note about public and pages overlap #10287

Merged
merged 5 commits into from Jan 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/basic-features/static-file-serving.md
Expand Up @@ -18,4 +18,4 @@ export default MyImage

> Don't name the `public` directory anything else. The name can't be changed and is the only directory that **Next.js** uses to serve static assets.

> If you ever add a static asset that conflicts with the name of a page in the `pages` directory, the public file will be ignored in favor of the file in `pages`.
> Make sure you don’t have static assets in conflict with files in the `pages` directory, as this will result in an error.
Timer marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Make sure you don’t have static assets in conflict with files in the `pages` directory, as this will result in an error.
> Make sure you don’t have static assets in conflict with files in the `pages` directory, as this will result in an error. An example of a conflict would be `public/hello` and `pages/hello.js` but `public/hello.txt` and `pages/hello.js` would not be as the `.txt` extension prevents them from conflicting

It might be good to show an example of a conflict so they understand what to avoid or we could link the err.sh here https://github.com/zeit/next.js/blob/canary/errors/conflicting-public-file-page.md