Commit graph

1499 commits

Author SHA1 Message Date
Rafael Almeida
2bf8153c27
[with-typescript] Remove React.FC (#13643)
The motivation for this PR is well explained here: https://github.com/facebook/create-react-app/pull/8177
I can expand it to the other examples too if you agree with the change
2020-06-01 20:41:56 +00:00
Todor Totev
795d9319a6
Fix with antd ssg (#13611)
Closes #12664 
Closes #13604 

The culprit was not only changing the library directory, but also having the icons version past 4.0.6. Also, the components which used the library had to be adjusted according to the new changes.

Confirmed that it works both in production and development. Confirmed that it builds on dev and production.

![Alt Text](https://media.giphy.com/media/dZ46aA1Rs7Oi1wSQKU/giphy.gif)
2020-06-01 19:08:59 +00:00
Joe Haddad
7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
Akhila Ariyachandra
032ca0364d
Updated with-magic example with new Environment Variables Support in Next.js 9.4+ (#13623) 2020-06-01 19:19:48 +02:00
Luis Alvarez D
7a1724f326
[Examples] Remove unused file from with-redux (#13570)
Leftover from a past PR
2020-05-31 21:11:35 +00:00
Martin Bavio
f8f308d6dd
Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.

It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.

In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable. 

In the case of the `with-react-intl` example, the information doesn't seem to be set anymore on `__NEXT_DATA__`, so I just removed the default reference to it.
2020-05-31 20:20:01 +00:00
Todor Totev
11597655d9
Enhance with redux thunk example (#13576)
* Refactored the store so that it doesnt use getInitialProps

* Applied the changes in the _app file

* Refactored the wrapper so that it uses the new store flow

* Removed the old redux syntax

Instead of passing the state from the parent component, I have used the new redux hooks to retrieve the current state.

* The clock no longer requires state to be passed too

* Updated the variable names

* forgot to bring back hot reloading

* Applied requested change.
2020-05-31 11:53:01 -05:00
Todor Totev
bb23d37b28
Enhance with redux persist (#13577)
* Moved the state to the clock component

* Refactored the store according to the new requirements

* Refactored _app so it uses the new store

* This file is no longer needed

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-30 13:00:37 -05:00
Thor 雷神
ca816df4de
Stripe example updates (#13581)
- Update to latest stripe-node version and pin the exact version so the Types won't go out of sync
- Add the env var changes for next 9.4.4 (https://nextjs.org/blog/next-9-4#new-environment-variables-support)
  - Remove `next.config.js` as no longer needed.
- Add the Deploy to Vercel button
2020-05-30 17:32:36 +00:00
MichelleLucero
3dbddfa02a
[ EXAMPLES ] Added with-mongodb example (#13028)
* created with-mongodb, Next.js + MongoDB

Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Michelle Lucero <31500626+MichelleLucero@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

* modified for dotenv and environment var setup

* removed extra instructions on readme, linked it to the MongoDB guides

* changes to environment var

* replaced document with react logic

* removed Pet header

* removed isomorphic-unfetch

* replaced getInitialProps with getStaticProps (SSG)

* removed console log

* deleted next.config.js file

* fixed prettier styling

* fixed link 404 server rendering issue

* modified server path for delete/edit

* fixed prettier styling

* fixed a typo

* change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* fixed typo, change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* change .env to .env.local

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-mongodb/package.json

Co-authored-by: Joe Haddad <timer150@gmail.com>

* removed dotenv dev dependency

Co-authored-by: Joe Haddad <timer150@gmail.com>

* cleaned up code and instructions

* Update examples/with-mongodb/.gitignore

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* minor changes to code style and logic

* Updated index page and .env.local.example

* Updated new page

* Don't use SSG for the edit page

* Fixed revalidation issue

* Use es6 for the model

* Updated edit page

* Removed VERCEL_URL

* Updated readme and renamed env

* Added temporal vercel.json

* Removed seed until added with a script

* Updated package.json

* Renamed example in readme

* Renamed example

* Lint fix

Co-authored-by: liulanz <zhengliulan@gmail.com>
Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: sdhani <shania.dhani46@myhunter.cuny.edu>
Co-authored-by: liulanz <37808313+liulanz@users.noreply.github.com>
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-05-30 12:15:00 -05:00
Martin Bavio
2a473ab42c
Make Linaria great again (#13568)
This PR fixes https://github.com/vercel/next.js/issues/7769.

However, I would like for @jayu to confirm that it's ok to use the latest Linaria 2.0 alpha release. I can confirm from my local testing that it's working as expected.
2020-05-30 00:05:49 +00:00
Michael Albertz
44fbc24ccd
[Example] Add with-web-worker example (#13444)
Resolves: https://github.com/zeit/next.js/issues/12545

This PR adds an example which show how to bundle and use WebWorkers in a next.js app.

The issue mentions Typescript, but adding typescript to the example should be fairly simple by following the documentation and seems out of scope for a web-worker example.
2020-05-28 23:07:23 +00:00
Aral Roca Gomez
6b65efb624
Fix typo (#13523)
Fix a typo.
2020-05-28 22:29:54 +00:00
Rubén Sospedra
8d97353d38
Add example with next-translate (#13511)
Motivated by the need to deploy static sites while having a good i18n support¹ ² @vinissimus developed [next-translate](https://github.com/vinissimus/next-translate).

Here's the example ;)

References:
1. https://github.com/vercel/next.js/discussions/10651
2. https://github.com/vercel/next.js/pull/12535#issuecomment-624317275
2020-05-28 21:31:05 +00:00
Mathis Chenuet
16d2235882
Update proxy example to http-proxy-middleware ^1 (#13507)
The current example doesn't work if one try to reproduce it with a recent version of http-proxy-middleware.
2020-05-28 21:00:58 +00:00
Joe Haddad
db5b5a76a8
Update some examples to Vercel (#13477)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-28 13:32:29 +02:00
Chandu
5eafc1e92a
refactor(with-redux): update example to use getStaticProps (#13378)
@lfades hope this works. I have updated the example to show differences between client/ssr/ssg initial state in redux. Let me know if something needs to be changed.
2020-05-28 05:12:27 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Jimmy Merritello
001230e0a8
Add Route as Modal Page Example (#12945)
### Add dynamic routes to _with-route-as-modal_ example

This PR adds [dynamic routes](https://nextjs.org/docs/routing/dynamic-routes), [getStaticPaths](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation), and [getStaticProps](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) to the **with-route-as-modal** example. This change might also clear up some confusion here on https://github.com/zeit/next.js/issues/11971

Additionally this PR makes sure each modal route is also a modal **page.**

This is an important distinction and makes sure the experience is the same should the URL (route) be shared as a link. In other words, `index.js` need not be the only "entrypoint" to browsing the website.

With the additions in this PR, each post page is an actual page, so if you were to share the link for **Post 3** you'd get this:

<img src="https://user-images.githubusercontent.com/7191639/82058282-25ad7780-968a-11ea-94f1-9b4a36abccf9.png" width="200px" />

(clickable outer region brings you back to the 'gallery')

**Update:** I have also included the `pathname` to signal the difference in which page component is rendered

Rather than this (previously):

<img src="https://user-images.githubusercontent.com/7191639/82058199-0878a900-968a-11ea-97d2-e9e20c9267fc.png" width="200px" />

I have used a similar approach [here 🔗](https://hashiconf.com/digital-june/schedule/the-hitchhikers-guide-to-terraform-your-infrastructure)
2020-05-27 21:22:33 +00:00
Stephen Cefali
d98cd8ad31
Add release argument to SentryWebpackPlugin (#13459)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:28:02 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
TodorTotev
710997d494
refactor(with-sentry): example (#13434)
1. I updated all the packages.
2. Refactored the home component from class to functional
3. Example now uses getServerSideProps instead of getInitialProps
2020-05-27 16:11:46 +00:00
Benjamin Pearson
aef7f27072
Example: Static Generation of local Apollo GraphQL schema (#13202)
## What

An example to show how you can create a static generated build of Next.js (using the new `getStaticProps` and `getStaticPaths` functions) with data fetched from a local GraphQL schema. The same schema is used to host a GraphQL endpoint using the API Route `/api/graphql`.

## Why

I was setting up a static hosted website whereby data is stored in a set of local JSON files (pulled from a backend server at build time). I wanted to consume the content using the developer benefits that GraphQL provides and using a consistent interface the GraphQL API consumers would be using.

Within my page components I initially made GraphQL `fetch` calls to the locally running `/api/graphql` endpoint which worked well with `npm run dev`, however when it came to `npm run build` that endpoint was inaccessible (I tried both VERCEL_URL and localhost:3000) - which is now understandable given I read further the "[Write server-side code directly](https://nextjs.org/docs/basic-features/data-fetching#write-server-side-code-directly)" documentation.

This example may or may not be useful for others so please feel free to close, but I thought I would contribute incase it assisted others.

## Related Discussions

It looks as though this PR may help with some of the following discussions:
  - https://github.com/zeit/next.js/discussions/12785
  - https://github.com/zeit/next.js/discussions/10946
  - https://github.com/zeit/next.js/discussions/12182
  - https://github.com/zeit/next.js/discussions/11285

## Related Examples

The end solution for this PR was a combination of web discussions and seeing the `api-routes-graphql` example. Perhaps this PR should just update that example to use the new methods? Or maybe it is worth having both?
- https://github.com/zeit/next.js/blob/canary/examples/examples/api-routes-graphql

This is also similar to this example, although that example has more code in order to provide isomorphic Apollo Client for client side code use.
- https://github.com/zeit/next.js/blob/canary/examples/api-routes-apollo-server-and-client

## Errors Recieved
I've included the below errors as they are the ones I faced when figuring out the end solution. These may just help with SEO for others googling the same issue.

### Error when trying to use localhost:3000
```
> Build error occurred
{ FetchError: request to http://localhost:3000/api/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:3000
    at ClientRequest.<anonymous> (/vercel/7cf60e2b/.next/serverless/pages/content.js:1999:147829)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:401:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19) type: 'system', errno: 'ECONNREFUSED', code: 'ECONNREFUSED' }
```

### Error when trying to use VERCEL_URL
```
> Build error occurred
{ FetchError: invalid json response body at https://vercel.com/login?next=%2Fdeployments%2Fprojectnamehere.now.sh%3Fhost%3Dprojectnamehere.now.sh%26redirect%3D1%26section%3D reason: Unexpected token < in JSON at position 0
    at /vercel/3d91c11/node_modules/next/dist/compiled/node-fetch/index.js:1:133590
    at process._tickCallback (internal/process/next_tick.js:68:7) type: 'invalid-json' }
```
2020-05-27 06:05:10 +00:00
TodorTotev
4a02dc5a17
Refactor class components to functional @ examples (#13398)
**Affected examples**

with-segment-analytics
with-slate
with-portals-ssr ( _with-portals-ssr is based on a package not being updated in the last year_)
with-videojs
with-next-page-transitions
with-firebase-cloud-messaging
with-dynamic-app-layout
with-dynamic-import
with-next-transition
with-carbon-components
with-cerebral
with-custom-babel-config

Here and there I have removed some redundant imports as well. I believe with this PR, there are only 1 or 2 examples left using class-based components. If by any chance you find any, let me know and I'll refactor them too.

If you don't like anything or you want me to change something, please let me know.

**If there is anything else you'd like me to help with, I would be honored to assist.**
2020-05-27 05:14:26 +00:00
Jesse Jafa
2e5a7c8cc8
Removed redundant react imports from with-overmind (#13422)
Per https://github.com/zeit/next.js/issues/12964

Removed redundant react imports from next.js/examples/with-overmind
2020-05-27 04:12:07 +00:00
Joe Haddad
dcfa35faa6
Fix with-sentry-simple example (#13404)
Previous referencing the incorrect `Error` global.
2020-05-26 16:58:03 +00:00
Jesse Jafa
2828b01950
Fixing Redundant React imports on next.js/examples (#13384)
Per https://github.com/zeit/next.js/issues/12964

* with-ant-design
* with-dynamic-import
* with-iron-session
* with-monaco-editor
* with-next-page-transitions
* with-react-with-styles
* with-style-sheet
* with-why-did-you-render

Tested each example, working as intended, no additional issues presented
2020-05-26 15:03:58 +00:00
TodorTotev
7ec57c6c93
Refactor with rematch example (#13392) 2020-05-26 08:24:36 -04:00
Jesse Jafa
658e0f8d34
with-overmind server error because of incorrect getStaticProps return statement (#13385)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-26 11:06:46 +02:00
Jesse Jafa
5eac7cc042
Fixed with-iron-session to work on Windows systems (#13386)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-26 10:57:56 +02:00
Daniel Paz
599d6f71bb
Update Monaco Editor Example (#13369)
Changed the URLs inside the Monaco Editor Example: https://github.com/zeit/next.js/tree/canary/examples/with-monaco-editor

Converted the worker URL to start with the base URL.

The reason is if you use the Monaco example anywhere but in the main `pages` folder, it won't work since it uses a relative URL instead.

For example if we'll move the code to `pages/room/index.js` it won't work since it will try to search for the files inside `room/_next/_static/` instead of `_next/_static/`.

The base URL I added fixes the problem.
2020-05-25 22:22:28 +00:00
Erik
268d3572bc
[examples] with-ts-eslint-jest example app (#12025)
* set up with-ts-eslint-jest example app

* eslint ignore new app bc it has a conflicting eslintrc

* make eslint + husky setup manual

* clarify app README setup notes

* move page tests out of pages/ dir

* Simplifying configs

* extend "prettier"

* format fix

* Updated rules

* Added husky configs and removed debug option

* Removed notes and configuration

* Updated pages

* Added links to readme

* Added example to .prettierignore

* Updated snap

* Make the lint work

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-05-25 13:16:06 -05:00
TodorTotev
5a5e6004d7
Refactor with redux persist example (#13338)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

First and most important, removed the getInitialProps and used getStaticProps.

Then, I refactored Counter, DataList and Examples components.
I have refactored them from class-based components to functional. Also in each component the redux implementation was refactored using the new hooks API, which resulted in ~40% less code.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 17:28:39 +00:00
Giuseppe
73c8b8ca92
Update with-style-sheet example (#13323) 2020-05-25 17:11:50 +00:00
TodorTotev
f3ea363df7
Refactor with redux thunk example (#13336)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

1. I have changed the component from class to functional.
2. I have removed the getInitialProps and used getStaticProps instead.
3. I have removed the redundant connect to redux @ the index page, due to the fact that now we can dispatch the action with the required hook.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 16:55:33 +00:00
TodorTotev
cc4b0c7b40
Refactor with redux saga (#13342)
Related to [11014](https://github.com/zeit/next.js/issues/11014)

Upgraded all the packages from package.json, removed the saga-wrapper package since it is totally outdated to today's use.

I have refactored the whole example using the new API of the next-redux-wrapper package, using their new support of "getStaticProps".

All of the class components were converted to functional, using the new redux hooks API.

If you want me to change anything or you are not satisfied with any given change, I'm open to suggestions.
2020-05-25 16:21:35 +00:00
Takumasa Sakao
43a54fb338
Fix wrong README of blog-starter-typescript example (#13330)
* Replace blog-starter to blog-starter-typescript

* Fix unnecessary replacement
2020-05-25 08:57:17 +02:00
Mohsen Azimi
9fb2432b14
Add ThemedStyleSheet.registerInterface to react-with-styles example (#13284)
My [draft PR was merged](https://github.com/zeit/next.js/pull/13193) so let's at least keep the code in canary in a working state.
2020-05-23 22:12:24 +00:00
Koji Sugimoto
dc1658f107
[Examples] Added blog-starter-typescript (#12981)
* feature: add blog-starter-typescript

* chore: edit tailwind.config

* Fix linting

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-05-23 20:34:35 +02:00
Joseph Knowles
83827f76d3
Uncomment private key (#13277) 2020-05-23 11:19:28 -05:00
Sam Bokai
6ca26bd960
Rename import to solve conflicting usage of Error constructor (#13256) 2020-05-22 17:54:32 -05:00
Shu Uesugi
94e20be204
With mux video readme updates (#13253)
* Add demo and note to with-mux-video

* Update README.md
2020-05-22 16:47:39 -05:00
Dylan Jhaveri
32dece149e
Add example: with-mux-video (#13120)
* yarn create next-app

* create an upload show page

* create upload page to handle in-progress upload and asset when it is ready

* move things to a layout component

* add some button styling

* poll for updates intelligently by dynamically setting refreshInterval on SWR hook

* better title

* edit gitignore, add MIT license use next 'latest'

based on feedback from https://github.com/zeit/next.js/pull/12723

* add some messages and spinner to make this a little nicer

* update README with environment variables info and Mux account info

* add .now to gitignore

* cleaner uploading state - redirect to /v/:playback_id when complete

* hardset image width in footer

* remove unused styles

* adjust title font size on mobile and adjust footer height on mobile

* use upchunk 1.0.8 so we don't have to dynamically load it

* cleaner error message handling

* fix brief error from returning Router on the render

* yarn lint-fix

* update README with note about .env.local

* add min height so the layout doesn't shift after selecting a file

* set poster attribute at video element

* use getStaticProps and fallback:true to render meta tags for social sharing

* create a pages/asset/:id route that we can be on while in the preparing state

* add copy about Mux, add twitter share widget

* add flash message about video ready for playback

* call it pre-rendered instead of server-side rendered

* pre-rendering, not server-side rendering

* Next.js not NextJS

* handle asset creation errors in the UI

* call hls.destroy() when the component is unmounted

* Updated readme and renamed .env.local

* Updated description

* add suggested patch with links to source code https://github.com/zeit/next.js/pull/13120#issuecomment-632858572

* Added vercel.json

* Updated some links

* Removed Prerequisites

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-05-22 16:13:12 -05:00
TodorTotev
cb1d744151
with-monaco-editor-example-fix (#13186)
* Modified nextjs config so that it works with all types of fonts and images.

* Update next.config.js

* Fix code

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-22 20:11:01 +02:00
Mohsen Azimi
c67908c9a5
Upgrade react-with-styles to version 4 (#13193)
Currently failing because `withStyles` can't read the interface from context:


```
Unhandled Runtime Error
TypeError: Cannot read property 'createLTR' of undefined
webpack-internal:///./node_modules/react-with-styles/lib/withStyles.js (150:33)
```

Manually registering the interface resolves the issue:

```diff
diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js
index 91d09a2a9..a393572b8 100644
--- a/examples/with-react-with-styles/pages/_app.js
+++ b/examples/with-react-with-styles/pages/_app.js
@@ -2,11 +2,16 @@ import App from 'next/app'
 import React from 'react'
 import WithStylesContext from 'react-with-styles/lib/WithStylesContext'
 import AphroditeInterface from 'react-with-styles-interface-aphrodite'
+import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
 
 import defaultTheme from '../defaultTheme'
 
 class MyApp extends App {
+    constructor(props) {
+        super(props);
+        ThemedStyleSheet.registerInterface(AphroditeInterface)
+    }
   render() {
     const { Component, pageProps } = this.props
```

But that's not how it is documented. I'm following up with react-with-styles to see if this is a bug.
2020-05-22 17:54:36 +00:00
Jack Moore
ed2ca820b0
Created Expo TypeScript example project (#13182) 2020-05-22 19:21:46 +02:00
Alejandro Ñáñez Ortiz
71d899f128
Add urql to the examples list (#13006)
* Install UrQL dependencies

- Created the examples folder `with-urql`
- Installed the dependencies
- Got a simple index.js page setup

* Basic UrQL example

- Connects to Pokemon GraphQL API

* Loading Pokemon list + Pokemon page

- Using `isomorphic-unfetch` because `urql` uses `window.fetch` to get data because we need to query the GraphQL API using Node (in `getStaticProps`)
- Deleted `_app.js` since we're not using UrQL to query data on the clientside
- Put all GraphQL related code in `/graphql`

* Update README for UrQL example

* Update urql casing

* Update examples/with-urql/graphql/client.js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-urql/pages/index.js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update examples/with-urql/pages/pokemon/[name].js

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Fix linting

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-22 18:56:34 +02:00
xliusstk
6c5efd7b09
Fix ssr-caching example (#12180)
cacheable-response.get expects a get(req, res) method signature:
https://www.npmjs.com/package/cacheable-response#get

Before the change:
```
curl -s  -v http://localhost:3000/blog/first 2>&1 | grep HTTP/1.1
> GET /blog/first HTTP/1.1
< HTTP/1.1 404 Not Found
```
After the change:
```
curl -s  -v http://localhost:3000/blog/first 2>&1 | grep HTTP/1.1
> GET /blog/first HTTP/1.1
< HTTP/1.1 200 OK
```

This is a partial fix of https://github.com/zeit/next.js/issues/12019 to make the example work. However it doesn't fix the error 
```
(node:62360) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
``` , which will need a change at server/next-server.ts

See related issue:
https://github.com/zeit/next.js/discussions/11525 
https://github.com/zeit/next.js/issues/11665
2020-05-22 16:29:37 +00:00
Marcus Silva
0b9475624f
chore: remove-redundant-example-import (#13175)
This issue is related to #12964 

**I changed the following examples:**
`with-zeit-fetch` 
`with-why-did-you-render`
`with-styletron`
`custom-server-fastify`
`custom-server-express`
`with-why-did-you-render`
`custom-server-hapi`
`custom-server-koa`
`custom-server-polka`
`custom-server-typescript`
`progressive-render`
`ssr-caching`
`svg-components`
`using-preact`
`with-ant-design`
2020-05-22 16:13:37 +00:00
Willian Justen
44d74e399f
chore: Remove react redundant imports on examples (#13169)
* Remove React redundant import on `analyze-bundles` example

 Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `api-routes-apollo-server-and-client-auth` example

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `custom-server` example

    Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

* Remove React redundant import on `custom-server-actionhero` example

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>

Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
2020-05-22 17:37:09 +02:00