Skip to content

enhanceApp does not always await all promises on page refresh #2074

Closed
adamlaska/osmos-cosmos-sdk
#5
@staghouse

Description

@staghouse
  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

  1. Create enhanceApp.js
  2. Add 1 or more Promises
  3. Store promises in Vue.prototype, siteData, etc, for example, Vue.prototype.myPromisedData = await myPromiseFunction(), though it doesnt matter if its a function or try/catch with storage on success
  4. Retrieve, for example, this.myPromisedData in a component

What is expected?

this.myPromisedData should always return what data is expected

What is actually happening?

The data returns undefined/promise pending/sometimes loads/only returns some promises. Its all wildly inconsistent other than the first promise returned has a higher chance of returning valid.

This seems to be a local-only issue as it does not happen on my production server. Could it be related to the HMR?

Other relevant information

  • Output of npx vuepress info in my VuePress project:
  System:
    OS: macOS 10.15.1
    CPU: (8) x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
  Binaries:
    Node: 12.8.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.10.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 78.0.3904.108
    Firefox: 71.0
    Safari: 13.0.3
  npmPackages:
    @vuepress/core:  1.0.3 
    @vuepress/theme-default:  1.0.3 
    vuepress: ^1.0.3 => 1.0.3 
  npmGlobalPackages:
    vuepress: Not Found

Metadata

Metadata

Assignees

No one assigned

    Labels

    has PRHas a related PRtype: enhancementRequest to enhance an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions