Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Current Behavior

{ Error: No page context

at Function._callee$ (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/lib/index.js:169:25)

at tryCatch (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/runtime.js:62:40)

at Generator.invoke [as _invoke] (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/runtime.js:296:22)

at Generator.prototype.(anonymous function) [as next] (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/r

untime.js:114:21)

at step (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/node_modules/@babel/runtime/helpers/asyncToGener

ator.js:12:30)

at _next (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/node_modules/@babel/runtime/helpers/asyncToGene

rator.js:27:9)

at /Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7

at new Promise (/Users/liumin/Desktop/next/with-redux-saga/node_modules/core-js/library/modules/es6.promise.js:177:7)

at Function. (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/node_modules/@babel/runtime/helpers/asyncToGenerator.js:7:12)

at Function.value [as getInitialProps] (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next-redux-wrapper/lib/index.js:211:25)

at _callee$ (/Users/liumin/Desktop/next/with-redux-saga/node_modules/next/dist/lib/utils.js:111:30)

at tryCatch (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/runtime.js:62:40)

at Generator.invoke [as _invoke] (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/runtime.js:296:22)

at Generator.prototype.(anonymous function) [as next] (/Users/liumin/Desktop/next/with-redux-saga/node_modules/regenerator-runtime/runtime.js:114:21)

at step (/Users/liumin/Desktop/next/with-redux-saga/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)

at _next (/Users/liumin/Desktop/next/with-redux-saga/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9) sourceMapsApplied: true }

Steps to Reproduce (for bugs)

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-saga

cd with-redux-saga

yarn

yarn add next next-redux-saga next-redux-wrapper

yarn dev

Context

Your Environment

Tech
Version

next
6.0.1

node
v10.0.0

OS
macOS 10.13.4

browser
chrome

etc

package.json

{

"name": "with-redux-saga",

"version": "1.0.0",

"license": "MIT",

"scripts": {

"dev": "next",

"build": "next build",

"start": "next start"

},

"dependencies": {

"es6-promise": "4.1.1",

"isomorphic-unfetch": "2.0.0",

"next": "^6.0.1",

"next-redux-saga": "^3.0.0-beta.1",

"next-redux-wrapper": "^2.0.0-beta.6",

"react": "^16.0.0",

"react-dom": "^16.0.0",

"react-redux": "5.0.5",

"redux": "3.7.2",

"redux-saga": "0.15.4"

},

"devDependencies": {

"redux-devtools-extension": "2.13.2"

}

}

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The recent change in Next.js 5.0.0 removed the poweredByHeader options from next.config.js and instructs the user to remove it in their custom server.

Current Behavior

X-Powered-By header cannot be removed or overwritten in custom Express or Koa server.

Steps to Reproduce (for bugs)

Tested using Express & Koa examples.

Express

https://custom-server-express-nobxbpklyw.now.sh

const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()

app.prepare()
.then(() => {
const server = express()

server.get('/a', (req, res) => {
return app.render(req, res, '/b', req.query)
})

server.get('/b', (req, res) => {
return app.render(req, res, '/a', req.query)
})

server.get('/posts/:id', (req, res) => {
return app.render(req, res, '/posts', { id: req.params.id })
})

server.get('*', (req, res) => {
res.removeHeader('x-powered-by')
return handle(req, res)
})

server.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})

Koa

https://custom-server-koa-wxksegmzhf.now.sh

const Koa = require('koa')
const next = require('next')
const Router = require('koa-router')

const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()

app.prepare()
.then(() => {
const server = new Koa()
const router = new Router()

router.get('/a', async ctx => {
await app.render(ctx.req, ctx.res, '/b', ctx.query)
ctx.respond = false
})

router.get('/b', async ctx => {
await app.render(ctx.req, ctx.res, '/a', ctx.query)
ctx.respond = false
})

router.get('*', async ctx => {
await handle(ctx.req, ctx.res)
ctx.respond = false
})

server.use(async (ctx, next) => {
ctx.res.statusCode = 200
ctx.response.remove('X-Powered-By')
await next()
})

server.use(router.routes())
server.listen(port, (err) => {
if (err) throw err
console.log(`> Ready on http://localhost:${port}`)
})
})

Context

Your Environment

Tech
Version

next
5.0.0

node
8.8.1

OS
macOS 10.13.3

browser
Chrome