mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(compat): cannot read property setLegacyMiddleware of undefined (#82)
This commit is contained in:
parent
2d0ff10892
commit
67a82a7ab9
@ -48,7 +48,9 @@ export default function nuxt2CompatModule () {
|
||||
nuxt.hook('modules:done', () => {
|
||||
const { middleware, legacyMiddleware } =
|
||||
resolveMiddleware(nuxt.options.serverMiddleware, nuxt.resolver.resolvePath)
|
||||
nuxt.server.setLegacyMiddleware(legacyMiddleware)
|
||||
if (nuxt.server) {
|
||||
nuxt.server.setLegacyMiddleware(legacyMiddleware)
|
||||
}
|
||||
nitroContext.middleware.push(...middleware)
|
||||
nitroDevContext.middleware.push(...middleware)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user