Hi, I went into trouble when using renderRoute. The following is what I did:
Mac OS X EI Capitan 10.11.6 Node v7.7.4
$ vue init nuxt/koa (choose koa v2)
$ yarn
$ npm run dev # which works fine
// app.js
// ...
// Change the middleware to use renderRoute
app.use(async (ctx, next) => {
ctx.status = 200 // koa defaults to 404 when it sees that status is unset
// await nuxt.render(ctx.req, ctx.res)
const result = await nuxt.renderRoute('/')
console.log(result.error)
})
$ npm run dev # error is printed
Error Message:
{ statusCode: 500,
message: 'Cannot read property \'url\' of undefined' }
Am I using renderRoute in a wrong way? Any idea? Thanks!
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c370">#c370</a>)</em></sub></div>