Nuxt.js: Issue with middleware when layout uses Vue.extend

Created on 9 Jan 2019  路  3Comments  路  Source: nuxt/nuxt.js

Version

v2.3.4

Reproduction link

https://github.com/chanlito/nuxt-middleware-bug

Steps to reproduce

So middleware doesn't seem to work when my layout is written like below:

<template>
  <div>
    <div>Layout</div>
    <nuxt/>
  </div>
</template>

<script>
import Vue from 'vue';

export default Vue.extend({ // <-- this doesn't
  middleware: 'ok',
});
</script>

But this works.

<template>
  <div>
    <div>Alt Layout</div>
    <nuxt/>
  </div>
</template>

<script>
export default {
  middleware: 'ok',
};
</script>

What is expected ?

Middleware should work fine with layout created with Vue.extend

What is actually happening?

Not working.

This bug report is available on Nuxt community (#c8437)
available soon bug-report

Most helpful comment

Hey @chanlito

Thank you very much for this bug report and reproduction link.

This issue should be resolved with https://github.com/nuxt/nuxt.js/commit/521ac20e298b6a7f090cdedce63098f2c234417f and should be available in next version of nuxt-edge tonight :)

All 3 comments

On pages middleware seems to work fine with or without Vue.extend

Hey @chanlito

Thank you very much for this bug report and reproduction link.

This issue should be resolved with https://github.com/nuxt/nuxt.js/commit/521ac20e298b6a7f090cdedce63098f2c234417f and should be available in next version of nuxt-edge tonight :)

Seems to be working now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pehbehbeh picture pehbehbeh  路  3Comments

mattdharmon picture mattdharmon  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

mikekidder picture mikekidder  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments