question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

context.app's type is a Vue instance

See original GitHub issue

Version

v2.6.3

Reproduction link

https://nuxtjs.org/api/context

Steps to reproduce

Type of context.app is defined as Vue [1] but it isn’t really a Vue instance. It’s just an object with root Vue instance options and also optionally other stuff injectected manually from plugins or through inject function.

Documentation is also confused about it. It says type = Root Vue Instance but in description it says The root Vue instance *options* that includes all your plugins. (emphasis mine).

What is expected ?

context.app doesn’t bare Vue type but something custom.

What is actually happening?

context.app type is Vue.

Additional comments?

[1] https://github.com/nuxt/nuxt.js/blob/a88e8b60c75da3f8c9d6bd9b32e00e03d6400b9d/packages/vue-app/types/index.d.ts#L17

<div align="right">This bug report is available on Nuxt community (#c9159)</div>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
rchlcommented, May 8, 2019

Yes, it seems it is an ComponentOptions.

It’s:

Now how should the nuxt type be called? Something like NuxtComponentOptions would be most relevant but it doesn’t go along well with how this variable is called. 😃

0reactions
kevinmarreccommented, May 11, 2019

@rchl I created a PR to fix the type and this context.app confusion https://github.com/nuxt/nuxt.js/pull/5701 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

context.app's type is a Vue instance · Issue #26 · nuxt/typescript
Type of context.app is defined as Vue [1] but it isn't really a Vue instance. It's just an object with root Vue instance...
Read more >
The Vue Instance
A Vue application consists of a root Vue instance created with new Vue , optionally organized into a tree of nested, reusable components....
Read more >
Creating a Vue Application - Vue.js
Every Vue application starts by creating a new application instance with the createApp function: js import { createApp } from 'vue' const app...
Read more >
Adding Instance Properties - Vue.js
The Context of Prototype Methods​​ In case you're not aware, methods added to a prototype in JavaScript gain the context of the instance....
Read more >
Application API - Vue.js
Type. ts interface App { mount(rootContainer: Element | string): ComponentPublicInstance } · Details. The argument can either be an actual DOM element or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found