Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with middleware when layout uses Vue.extend #4724

Closed
chanlito opened this issue Jan 9, 2019 · 3 comments
Closed

Issue with middleware when layout uses Vue.extend #4724

chanlito opened this issue Jan 9, 2019 · 3 comments

Comments

@chanlito
Copy link

chanlito commented Jan 9, 2019

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)
@ghost ghost added the cmty:bug-report label Jan 9, 2019
@chanlito chanlito changed the title Issue with middleware with Vue.extend Issue with middleware when layout is uses Vue.extend Jan 9, 2019
@chanlito chanlito changed the title Issue with middleware when layout is uses Vue.extend Issue with middleware when layout uses Vue.extend Jan 9, 2019
@chanlito
Copy link
Author

chanlito commented Jan 9, 2019

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

Atinux added a commit that referenced this issue Jan 10, 2019
@Atinux
Copy link
Member

Atinux commented Jan 10, 2019

Hey @chanlito

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

This issue should be resolved with 521ac20 and should be available in next version of nuxt-edge tonight :)

@chanlito
Copy link
Author

Seems to be working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants