Home

Issue: 2270

How does the 'generate' work with middleware ?

[issue link]

I found a problem what is, I want to use a middleware which called ‘userAgent’

in nuxt.config.js,like this:
router: {
middleware: [‘userAgent’],
},
as the document said.

but, when I run ‘npm run generate’ code, it warning

{
Error: ENOENT: no such file or directory, lstat '/Users/summerd/Documents/
workspace/cy/ssr-template/dist/index.html’
errno: -2,
code: ‘ENOENT’,
syscall: ‘lstat’,
path: ‘/Users/summerd/Documents/workspace/cy/ssr-template/dist/index.html’
}

and the dist fold I can’t find index.html and 200.html. Does any body know something about this, and know how can I build successfully with router: { middleware: ‘xxxx’ } ?

This question is available on Nuxt.js community (#c1988)