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.

Getter named as "loading" not acceptable

See original GitHub issue

I got myself losing tons of hours trying to track a bug in my app to discover that nuxt-property-decorator does not accept a getter named “loading”.

<template>
  <div>{{ loading }}</div>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'

@Component
export default class Playground extends Vue {
  get loading() {
    return 'loading...'
  }
}
</script>

[Vue warn]: Property or method "loading" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

Steps to reproduce

  • yarn create nuxt-app my-nuxt-ts-app leave default to all options except javascript/typescript part (select typescript)
  • yarn add nuxt-property-decorator
  • on pages/index.vue:6 replace to {{ loading }}
  • replace Vue.extend to a class component as above
  • yarn dev

Sandbox https://codesandbox.io/s/nuxt-property-decorator-loading-bug-orv7l?file=/pages/index.vue

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
aapelismithcommented, Mar 8, 2021

You have to change your variable name to avoid this problem

0reactions
Pacheco95commented, Mar 8, 2021

I dont think this problem was caused by progress bar configuration because it is setted up in nuxt.config.ts, not in the component definition

Read more comments on GitHub >

github_iconTop Results From Across the Web

using getter/setter does not allow use same name identifier as ...
it complains "duplicate identifier". I understand the identifier should be a private _CAT. The question here is why using getter/setter causes ...
Read more >
Should a getter throw an exception if its object has invalid state?
If surname or name being null is a valid state for the object, then handle it accordingly. But if it's not a valid...
Read more >
TypeError: setting getter-only property "x" - JavaScript | MDN
There is an attempt to set a new value to a property for which only a getter is specified. While this will be...
Read more >
Getters and Setters: Manage Attributes in Python
These methods are commonly known as getter and setter methods. ... common in other programming languages, that's not the case in Python.
Read more >
Effective Go - The Go Programming Language
The package name is only the default name for imports; it need not be unique across all ... Go doesn't provide automatic support...
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