v2.3.2 (koa)
init project
Hope NPM start works properly
app.use(ctx => {
ctx.status = 200
return new Promise((resolve, reject) => {
ctx.res.on('close', resolve)
ctx.res.on('finish', resolve)
nuxt.render(ctx.req, ctx.res, promise => {
// **promise is undefied**
promise.then(resolve).catch(reject)
})
})
})
I hope the authorities can pay attention to it, which leads to difficulties in deployment
This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c8914.
This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c8914.
fuck
Same issue here. Could you fix this problem?
I created a new Nuxt project then copied its /server folder to the current project.
It was fixed now!
@zlgb-wow
nuxt.render is a reference of connect.js app, unfortunately there is no promise as a parameter of the callback, so you may try:
app.use((ctx) => {
ctx.status = 200
return new Promise((resolve, reject) => {
ctx.res.on('close', resolve)
ctx.res.on('finish', resolve)
nuxt.render(ctx.req, ctx.res, err => err ? resolve() : reject(err))
})
})
And about your code, is it from any official Nuxt module or repo ? If so, could you please send me the link and I'll fix it.
Most helpful comment
fuck