FranckFreiburger/vue3-sfc-loader

using await in setup causing e not a function

roger-castaldo opened this issue · 4 comments

Describe the bug

When using an await call inside a setup script I keep getting "TypeError: e is not a function" under withAsyncContext

To Reproduce

create an async function, for example HasValidAccess that is in an imported js file.

add code similar to:
let canAccess = await HasValidAccess('EditObjectMetaFlagConfiguration');

inside the <script setup> tag.

Expected behavior

an error does not occur, expecting canAccess to have the value from the async call.

Versions

  • Browser (name & version): Chrome (Version 114.0.5735.110 (Official Build) (64-bit))
  • vue3-sfc-loader: 0.8.4

Additional context

This is due to the fact that the version of dependency @vue/compiler-sfc does not support the latest version of Vue.
Upgrade @vue/compiler-sfc to 3.3.4 can fix it.

o777o commented

This is due to the fact that the version of dependency @vue/compiler-sfc does not support the latest version of Vue. Upgrade @vue/compiler-sfc to 3.3.4 can fix it.

I upgrade @vue/compiler-sfc and @vue/compiler-dom to 3.3.4 and build my verson.
But when I use top-level await inside <script setup>,I made an error TypeError: n.isBuiltInDirective is not a function.

o777o commented

This is due to the fact that the version of dependency @vue/compiler-sfc does not support the latest version of Vue. Upgrade @vue/compiler-sfc to 3.3.4 can fix it.

This is due to the fact that the version of dependency @vue/compiler-sfc does not support the latest version of Vue. Upgrade @vue/compiler-sfc to 3.3.4 can fix it.

I upgrade @vue/compiler-sfc and @vue/compiler-dom to 3.3.4 and build my verson. But when I use top-level await inside <script setup>,I made an error TypeError: n.isBuiltInDirective is not a function.

I found that the reason is <template> contains v-loading in ElementUI Plus, upgrade @vue/shared and vue to latest version can fix it.

Hi, this will be fixed in the next release !