nuxt-community/composition-api

async functions require extra time with `nuxt generate`

開放

#44 建立於 2020年5月8日

 (10 則留言) (0 個反應) (1 位負責人)TypeScript (97 個分叉)auto 404
help wanted

倉庫指標

星標
 (702 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

🐛 The bug When generated files are produced, async functions or serverPrefetches don't correctly populate the Nuxt context.

Note: I believe this is an issue with Nuxt rather than with nuxt-composition-api.

🛠️ To reproduce Steps to reproduce the behavior:

  1. Clone this repo.
  2. Remove interval: 2000 from test/fixture/nuxt.config.js
  3. Run yarn nuxt generate -c test/fixture/nuxt.config.js
  4. Inspect ./dist/ssr-ref/index.html to see not all ssrRefs injected in page

ℹ️ Workaround You can add time between pages being generated to allow for any async functions to resolve, if you are pre-generating any of your pages.

nuxt.config.js:

{
  generate: {
    // choose to suit your project
    interval: 2000,
  }
}

貢獻者指南