nuxt-community/composition-api
async functions require extra time with `nuxt generate`
开放
#44 创建于 2020年5月8日
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:
- Clone this repo.
- Remove
interval: 2000fromtest/fixture/nuxt.config.js - Run
yarn nuxt generate -c test/fixture/nuxt.config.js - Inspect
./dist/ssr-ref/index.htmlto 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,
}
}