Commit graph

155 commits

Author SHA1 Message Date
JJ Kasper
9f6d5b14df
Add test and errsh for mixed notFound/redirect error (#19076)
This ensures the mixed `notFound`/`redirect` error is shown correctly and adds an err.sh for the error. 

Closes: https://github.com/vercel/next.js/issues/18727
2020-11-11 22:02:11 +00:00
Steven
917d594ca8
Print error during next export with default image loader (#19032)
Fixes #18356
2020-11-11 15:46:48 +00:00
Gerald Monaco
80671273ca
Revert "Remove next-head-count (#16758)" (#18713)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-11-10 16:35:47 -05:00
Steven
2b94b1eea6
Update default widths configuration to handle 2x/3x DPI (#18717)
- Update default `deviceSizes`
- Add default `imageSizes`
- Use `layout` value to determine which `srcset` to use

Fixes #18420 
Closes #18714
2020-11-03 02:12:46 +00:00
Lukáš Huvar
a6759c62ad
docs: fix missing comma in invalid redirect gssp (#18580)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-10-31 23:37:06 -04:00
Steven
b7daae418b
Update install-sharp.md (#18508)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-10-30 10:56:11 -04:00
JJ Kasper
8b4d6246f3
Add err.sh for i18n config errors (#18425)
This adds an err.sh with info that can help when tracking down errors from invalid i18n config in next.config.js
2020-10-29 03:48:24 +00:00
JJ Kasper
e20dba2cf0
Add err.sh for image config errors (#18424)
* Add err.sh for image config errors

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2020-10-28 20:53:58 -05:00
JJ Kasper
27f56eb325
Add err.sh for missing images domain (#18325)
* Add err.sh for missing images domain

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* Update test

Co-authored-by: Steven <steven@ceriously.com>
2020-10-27 16:55:21 -05:00
Steven
80bf81a3cf
Move sharp to optionalDependencies (#18068)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-21 12:21:42 +02:00
Steven
d3741d5ec5
Add support for Image Optimizer (#17749)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-10-16 13:10:01 +02:00
JJ Kasper
782b7e48ec
Add warning when exporting with custom routes (#17538)
This adds a warning when `next export` and custom routes are defined  outside of a platform that supports them since they won't be applied anymore.
2020-10-05 07:11:06 +00:00
Joe Haddad
c6ff918777
Update no-document-viewport-meta.md 2020-09-21 21:31:51 -04:00
Sam Dornan
0c4022e419
Fix invalid href error message (#17183) 2020-09-18 15:50:02 +00:00
Joe Haddad
9adf3bb637
Improve Document Component Error (#17047) 2020-09-12 13:39:16 -04:00
JJ Kasper
47d983f71f
Add error when href interpolation fails (#16946)
This adds an error when interpolation fails to make sure invalid `href`s aren't accidentally used and an invalid URL is built. 

Closes: https://github.com/vercel/next.js/issues/16944
2020-09-10 20:05:02 +00:00
Gerald Monaco
039eb817e1
Remove next-head-count (#16758)
Removes `next-head-count`, improving support for 3rd party libraries that insert or append new elements to `<head>`.

---

This is more or less what a solution with a `data-` attribute would look like, except that instead of directly searching for elements with that attribute, we serialize the elements expected in `<head>` and then find them/assume ownership of them during initialization (in a manner similar to React's reconciliation) based on their properties.

There are two main assumptions here:
1. Content is served with compression, so duplicate serialization of e.g. inline script or style tags doesn't have a meaningful impact. Storing a hash would be a potential optimization.
2. 3rd party libraries primarily only insert new, unique elements to head. Libraries trying to actively manage elements that overlap with those that Next.js claims ownership of will still be unsupported.

The reason for this roundabout approach is that I'd really like to avoid `data-` if possible, for maximum compatibility. Implicitly adding an attribute could be a breaking change for some class of tools or crawlers and makes it otherwise impossible to insert raw HTML into `<head>`. Adding an unexpected attribute is why the original `class="next-head"` approach was problematic in the first place!

That said, while I don't expect this to be more problematic than `next-head-count` (anything that would break in this new model also should have broken in the old model), if that does end up being the case, it might make sense to just bite the bullet.

Fixes #11012
Closes #16707

---

cc @Timer @timneutkens
2020-09-09 01:41:04 +00:00
JJ Kasper
bc80fb4fb2
Add handling for redirects from getStaticProps/getServerSideProps (#16642)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-09-08 09:23:21 +02:00
JJ Kasper
a7550bf1d7
Add error when document component isn't rendered (#16459)
If a custom `_document` is added but not all of the expected document components are rendered it can cause unintended errors as noticed in https://github.com/vercel/next.js/issues/10219 so this adds detecting when one of the expected document components isn't rendered and shows an error. 

Closes: https://github.com/vercel/next.js/issues/10219
2020-08-24 02:42:51 +00:00
Joe Haddad
fc98c13a2e
Warn on duplicate Sass deps (#16398)
Fixes #13953
2020-08-20 16:05:29 +00:00
Kevin Mårtensson
aa4b87e357
Handle cases where config is exported after its declaration (#16211)
AMP will still not work correctly when switching between non-AMP and AMP pages in development mode because of https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/plugins/next-page-config.ts#L116-L120.

Fixes #15704.
2020-08-17 17:24:18 +00:00
Joe Haddad
882288b532
Warn when Fast Refresh is disabled (React <16.10) (#15931) 2020-08-06 10:41:11 -04:00
matamatanot
2c424446b8
fix typo in export-all-in-page (#15925) 2020-08-06 00:11:11 +00:00
Joris
0fd1958ae4
Disallow re-export all exports from Next.js pages (#14325)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-05 16:21:40 -04:00
Jan Potoms
92304404a4
Disallow basePath: false for internal routes (#15837) 2020-08-04 17:50:09 +00:00
Jan Potoms
ad5c736798
Remove unused error (#15748)
Irrelevant since https://github.com/vercel/next.js/pull/15379
2020-07-31 17:29:09 +00:00
Joe Haddad
63e66ef0b0
Update gssp-export Error (#15529)
This pull request updates the `gssp-export` error for clarity.

Fixes #15527
2020-07-27 18:47:00 +00:00
Jan Potoms
e4e3ad38fd
Upgrade actions/cache to v2.1.0 (#15415) 2020-07-23 00:06:50 -04:00
Necmettin Karakaya
c2f38f2af0
[Fix] common misspelling errors (#15288)
For reference: https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2020-07-19 04:38:20 +00:00
Ashik Paul
4af7f6c7f5
Fixed a minor typo (#15077) 2020-07-12 18:28:24 +00:00
George Arthur
9d1d9c5235
Update prerender-error.md (#14875)
This is to further give more insight on one of the ways to fix prerendering errors especially with dynamic pages.
2020-07-10 19:01:17 +00:00
Eric Goerens
48aeb9fc4e
fixed typo in page-without-valid-component.md (#15022) 2020-07-10 18:44:17 +00:00
Ty Mick
1f5bbb3a8c
Add warning when viewport meta tag is added to _document.js (#13452)
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-07 01:43:16 -04:00
Yang Sun
a8d2c1ee95
modify global css import error message (#14639)
Fixes #14464
2020-06-30 05:25:02 +00:00
JJ Kasper
61b68730f8
De-experimentalize custom-routes (#14602)
This moves the custom-routes configs outside of the experimental section to prepare them for being made stable

Fixes: https://github.com/vercel/next.js/issues/14184
2020-06-27 09:18:18 +00:00
James Mosier
435bf65784
Warn/revert custom devtool in development mode (#14285)
Warn users and revert their `devtool` when they manually change the `devtool` in development mode. For this addition, I check to ensure the `devtool` is custom (i.e. different than what is set by Next) and has a value (`false` is fine as a custom `devtool`!).

As described in [this issue (13963)](https://github.com/vercel/next.js/issues/13963), changing the `devtool` in development mode can cause issues with performance.

Fixes #13963
2020-06-24 04:15:57 +00:00
stefanprobst
279ae19c7e
docs: update links to docs site (#14305)
this updates some links to the docs site to their new location
2020-06-18 09:54:07 +00:00
Timothy
d1c16124b5
Update instances of Now to Vercel where applicable (#13760)
This pull request renames various instances of `now` to `vercel` etc. in order to match content that's being updated on the Vercel platform.
2020-06-04 14:57:17 +00:00
Todor Totev
bad376127e
Detailed error and warnings upon next() call (#13539)
**First, apologies for a second PR on the same issue but I was working on this already so I thought I'd push it and let you decide which you want to merge.**

The PR is related to [13466](https://github.com/vercel/next.js/issues/13466).

Based on my research, the error happens if the options are empty, null, or undefined. That's why I have decided that the most proper check would be using the! post-fix expression operator may assert that its operand is non-null and non-undefined. ``if (options == null)``

(Optional)
I have also added a warning, which warns the user if the passed "dev" variable is not a boolean.

It's my first PR on the "packages" part of the repo so I'd be glad to receive all kinds of critics. If you want me to change or remove anything, I'm open to suggestions.

---

Fixes #13466
2020-06-03 03:19:29 +00:00
Joe Haddad
aab1fff861
Better NODE_ENV explanation (#13476)
After #12361, I've seen a few users ask "but why".

This PR updates the err.sh link to better explain the restriction.

It also provides an alternative!
2020-05-28 09:10:22 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Karl Horky
6ca00bfe31
Remove beta label from Netlify Plugins (#13465)
Netlify Plugins are out of beta!

https://www.netlify.com/blog/2020/05/27/netlify-build-plugins-are-here/
2020-05-27 20:30:39 +00:00
JJ Kasper
e2619359ec
Add warning when reserved pages are nested (#13449)
This adds a warning when a user has nested a reserved page `_error`, `_app`, or `_document` in their pages directory since it causes it to not be picked up and used by Next.js in the expected way

x-ref: https://github.com/zeit/next.js/pull/13425

<details>
<summary>Example of warning</summary>

<img width="927" alt="Screen Shot 2020-05-27 at 10 39 09" src="https://user-images.githubusercontent.com/22380829/83042315-24276c00-a007-11ea-9dc4-cabcc93571d2.png">
</details>
2020-05-27 16:45:53 +00:00
JJ Kasper
ef422467dc
Add error when exporting pages with fallback: true (#13063) 2020-05-19 09:29:34 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Tim Neutkens
313b552026
Enable .env support by default (#12911)
* Enable .env support by default

Given we've had tons of reports from various people that expected .env support to work even though they had dotenv installed already I think it's fine to enable it as a default:

Fixes #12728

* Remove old test

* Fix duplicate env loading

* Update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-15 14:02:16 -05:00
JJ Kasper
6972a09f43
Add message when automatic dotenv loading is disabled (#12744) 2020-05-11 16:32:33 -04:00
JJ Kasper
467b65a889
Add note about HoC possibly adding GIP to _app (#12491) 2020-05-05 00:11:25 -04:00
JJ Kasper
3af0fe5cf2
Add warning for non-standard NODE_ENV value (#12361) 2020-05-04 11:21:58 -05:00
Karl Horky
ed66d14ddd
Document persisting cache with Netlify Plugin (#12242) 2020-05-02 00:24:57 -04:00