* Set default `Error` status code to 404
This is an appropriate default behavior because:
1. When the server encounters an error, the `err` property is set.
2. When the client-side application crashes, the `err` property is set.
This means the "only" way to render the `/_error` page without an error
is when a page is not found (special condition).
Fixes#6243Closes#5437
* Add new integration test for client side 404
* single quotes
* Remove unused variable
* Standard needs to go away
* Whoops
* Check for null status code in res and err
* Only check response for valid statusCode
* convert export default anonymous functions into named functions
* change examples to function declaration and split export in classes
* change NextHead name to Head and rename component
* extract request login from auth
* add clarification that the monorepo is for deploy in Now only and fix typo
* Refactor HOC
- add authorization to HOC
- add displayName to HOC
- remove unnecessary `run`s in local routing
I've just thought of a way to improve the initial props page by adding
an example for a list/detail page structure. To do that, I've created a
separate `/detail` page, and a mock API which calls data from the array
we made on the previous PR.
A ListDetail component is created as an example for displaying detail.
Page structure is also cleaned up. Should I go ahead and add an example
on how to style with styled-jsx + its TS declarations? I might decide to
do it within this week anyway.
Update examples with-relay-modern and with-relay-modern-server-express to react-relay 2.0.0
- react-relay has started to use new Context API instead of Legacy Context API
- add `parseInt` because graphql 14.0.0 introduced stricter scalar value coercion
Closes#6157
This reverts the changes made in [this pr](https://github.com/zeit/next.js/pull/6109).
`redux-saga: "1.0.0"` changed the way it handles it's queues. Because of that we're still having trouble to implement the synchronous side-effects flow in `next-redux-saga`. See [this discussion](https://github.com/bbortt/next-redux-saga/pull/1) for more information.
Therefore I would feel more comfortable not to mislead users by giving them a non-working example in the main branch.
* Update README.md
I know I'm a moron for not understanding what's written in black on white, but... Maybe this will save someone an hour or two 😄
* Apply proposed changed
I tried to make the example a bit more descriptive. I changed `publicPath` in `now.config.js` to be `/_next/static/`, in place of `./`, and `outputPath` to `static/` in place of `static/css/`. The reason is that the webpack config will still fallback to `file-loader` for any content that is imported by the user and which is bigger that `8192` bytes. I think this content should not land in the css folder, which should probably stay css specific.
Moreover, for user content, like regular images, the former settings will fail.
If you have this:
```javascript
import LargeFile from './LargeFile.png'
```
it would be placed in `static/css/` but its url would resolve to `<base-url>/LargeFile.png`, which will fail. It works for semantic-ui alone, because `@zeit/next-css` will put the styles in `static/css/` and so `publicPath` of `./` would work just fine.
Putting assets in `static/` and setting `publicPath` to '/_next/static/' will resolve correctly for both semantic-ui related assets as well as for regular user assets.
I hope I am not mixing something up. I tested it locally and in serverless deployment, and this looks pretty consistent.
* Implement circular JSON err.sh link
* Add test for getInitialProps returning circular json
* Make test warn less
* Fix tests
* Add reference to original tests