You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
unplugin-vue2-script-setup does not hoist async import up and you get runtime error Uncaught ReferenceError: HelloWorld is not defined.
Possible solutions:
Ignore it 🙂
Pros: don't need to implement it
Cons: need to use separate script
Hoist async component imports
Pros: easy to implement - just hoist const Component = () => import()
Cons: different API from Vue 3
Add global defineAsyncComponent macro
Pros: API similar to Vue 3
Cons: When the app is migrated to Vue 3 will need to add missing imports. (Could be a pro with unplugin-auto-import)
Add virtual package (script-setup for example) that exports defineAsyncComponent
Pros: API similar to Vue 3, easy search and replace imports when the app is migrated to Vue 3
Cons: Need to add virtual package
@antfu, what solution do you prefer? I'm not sure if 3 or 4 is better.