-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
useAsyncData with comma breaks #15272
Copy link
Copy link
Closed
nuxt/framework
#8529Labels
Description
Environment
- Operating System:
Darwin - Node Version:
v14.19.1 - Nuxt Version:
3.0.0-rc.12 - Nitro Version:
0.6.0 - Package Manager:
yarn@1.22.19 - Builder:
vite - User Config:
telemetry,ssr,app,modules,formkit,purgeCSS,pwa,css,vite - Runtime Modules:
@pinia/nuxt@0.4.3,@kevinmarrec/nuxt-pwa@0.9.1,nuxt-font-metrics@0.2.1,nuxt-purgecss@2.0.0,@nuxtjs/html-validator@1.1.0,@vueuse/nuxt@9.3.1,@formkit/nuxt@1.0.0-beta.11 - Build Modules:
-
Reproduction
Not working:
const data = await useAsyncData(() =>
$fetch('https://api.nuxtjs.dev/mountains'),
)Working:
const data = await useAsyncData(() =>
$fetch('https://api.nuxtjs.dev/mountains')
)Describe the bug
If I have a , at the end of the $fetch it does not work, if I remove, it works.
If I have the , I have this on the console Uncaught SyntaxError: Unexpected token ',' (at edit.vue?macro=true:14:1)
Additional context
No response
Logs
No response
Reactions are currently unavailable
