-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect chunking when code has top-level await #10995
Comments
I guess the main module // main.ts
const locale = await loadDateFNSLocale({
locale: 'tr-TR',
storageKey: 'locale'
})
// ...
app.mount('#app') Assume that
I import locale module asynchronously, then it worked. // main.ts
async function initApp() {
const locale = await loadDateFNSLocale({
locale: 'tr-TR',
storageKey: 'locale'
})
// ...
app.mount('#app')
}
initApp() // load asynchronously or // main.ts
loadDateFNSLocale({
locale: 'tr-TR',
storageKey: 'locale'
}).then(locale => {
// load as promise
// ...
app.mount('#app')
}) |
Thank you, Is this a permanent solution ? |
This seems to be an upstream issue (rollup/rollup#4708). The current workaround is to avoid TLA as @luo3house said (thanks!). |
Going to close this as there's not much we can do. The linked rollup issue has some findings I made while trying to fix it upstream, but it was harder than expected. |
Failure to resolve the issue indicates why the issue should be closed. I think it should stay open because it's a bug. |
Describe the bug
my library write and used with vite.
but vite build and preview mode reload refresh page 2-3 time empty page.
but dev mode working all.
Reproduction
https://github.com/productdevbook/vite-bug-vue
Steps to reproduce
pnpm install
pnpm build
pnpm preview
chrome debugger mode this problem. console.log dont see and working
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: