- Use latest terser version (still 1 warning in the stable version which is an open PR)
- Add emitOnErrors instead of noEmitOnErrors
- Added trace-deprecations for Next.js core development
- Using `namedChunks` where possible, this will also allow for faster access to the chunks as we no longer have to look them up like we did before using `find`
- Using the new asset hooks introduced in the latest webpack beta
- Using the new externals function signature
While it is mentioned in the [link documentation](https://nextjs.org/docs/api-reference/next/link), I think it is useful to also explain in the dynamic route documentation that you need to include the as parameter when routing to a dynamic route/
## What
The current `gh-pages` example has issue when deploying.
This is how the error looks like:
![image](https://user-images.githubusercontent.com/1008093/88996697-827f0c80-d320-11ea-93bd-48141c321a65.png)
```
...
Export successful
The following paths are ignored by one of your .gitignore files:
out
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! next@1.0.0 deploy: `rm -rf node_modules/.cache && next build && next export && touch out/.nojekyll && git add out/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the next@1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
...
```
It's because `out` folder is added on `.gitignore` and the deploy script runs `git add out/`.
The fix is to remove `out` folder from `.gitignore`.
## How was it tested
run `npm run deploy`, it should be completed successfully.
I think this is necessary for IE11.
via [Webpack docs](https://webpack.js.org/migrate/5/#turn-off-es2015-syntax-in-runtime-code-if-necessary)
> By default, webpack's runtime code uses ES2015 syntax to build smaller bundles. If your build targets environments that don't support this syntax (like IE11), you'll need to set output.ecmaVersion: 5 to revert to ES5 syntax.
Thank you
`pageProps` should always be defined to ensure everything is working as expected although to prevent a breaking change this adds an additional check before attempting to access `pageProps` before hydration. It also adds tests to prevent regressing on this
Closes: https://github.com/vercel/next.js/issues/15647
This pull request:
1. Relocates tests to correct location
1. Tests more scenarios
1. Fixes a bug with anchors at the start of error message
1. Fixes react key warning error
Fixes#15599
Fixes https://github.com/vercel/next.js/issues/15595
- Updated the tailwindcss and tailwindcss-emotion examples to the latest version of tailwindcss
- Added a new `with-styled-jsx` example
- Updated the `basic-css` example to use CSS Modules instead of styled-jsx
- Added the examples to the documentation page for built-in css support
This updates collecting dynamic route params on Vercel to make sure that missing optional dynamic routes are undefined. Additional tests for this mode have also been added to ensure the params are being collected properly
Closes: https://github.com/vercel/next.js/issues/15579
errors in script execution will result in timeout instead of failure. This PR makes sure to pass all arguments to `.then` so error handling is correctly set up. (`.then` needs to be able to take a second argument). I also removed `.finally`.
I don't know why, but it looks like the following test does something that prevents the tests after it from opening a new browser window on azure. I'm giving up, I shuffled the tests to put this one last.
```js
it('shows warning when dynamic route mismatch is used on Link', async () => {
await showsError(
'/dynamic-route-mismatch',
/Mismatching `as` and `href` failed to manually provide the params: post in the `href`'s `query`/,
true,
true
)
})
```
It seems like the error occurs with `next export` when building the current example.
```
$ cd examples/with-electron-typescript
$ yarn && yarn build
Error occurred prerendering page "/detail". Read more: https://err.sh/next.js/prerender-error
Error: Error for page /detail: pages with `getServerSideProps` can not be exported. See more info here: https://err.sh/next.js/gssp-export
Error: Export encountered errors on following paths:
/detail
at exportApp (/Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/node_modules/next/dist/export/index.js:22:1166)
error Command failed with exit code 1.
```
I changed routes to statically resolve pages generating from `pages/detail.tsx` and added `getStaticPaths` and `getStaticProps`. so then it will export as follows
```
yarn run v1.22.4
$ next build renderer && next export renderer
Creating an optimized production build...
Compiled successfully.
Automatically optimizing pages...
Page Size First Load JS
┌ ○ / 336 B 62.6 kB
├ ○ /404 2.54 kB 61.6 kB
├ ○ /about 338 B 62.6 kB
├ ● /detail/[id] 440 B 62.7 kB
├ ├ /detail/101
├ ├ /detail/102
├ ├ /detail/103
├ └ /detail/104
└ ● /initial-props 530 B 62.8 kB
+ First Load JS shared by all 59.1 kB
├ static/pages/_app.js 983 B
├ chunks/commons.9facbe.js 10.9 kB
├ chunks/framework.b76773.js 40.3 kB
├ runtime/main.800476.js 6.22 kB
└ runtime/webpack.c21266.js 746 B
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
○ (Static) automatically rendered as static HTML (uses no initial props)
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
> using build directory: /Users/kstg/src/github.com/zeit/next.js/examples/with-electron-typescript/renderer/.next
copying "static build" directory
> No "exportPathMap" found in "next.config.js". Generating map from "./pages"
launching 7 workers
Exporting (0/4)
Exporting (1/4)
Exporting (2/4)
Exporting (3/4)
Exporting (4/4)
Export successful
Done in 11.47s.
```