Skip to content
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

Warning: withDefaults() is unnecessary when using defineProps() with destructuring #207

Open
nexoscreator opened this issue Dec 1, 2024 · 6 comments · May be fixed by #209
Open

Warning: withDefaults() is unnecessary when using defineProps() with destructuring #207

nexoscreator opened this issue Dec 1, 2024 · 6 comments · May be fixed by #209

Comments

@nexoscreator
Copy link

I am encountering a warning when using the @nuxtjs/google-adsense module in my Nuxt 3 project. The warning indicates that withDefaults() is unnecessary when defineProps() is used with destructuring. Here are the details:

Warning Message:

 WARN  [@vue/compiler-sfc] withDefaults() is unnecessary when using destructure with defineProps().
Reactive destructure will be disabled when using withDefaults().
Prefer using destructure default values, e.g., const { foo = 1 } = defineProps(...).

node_modules/@nuxtjs/google-adsense/dist/runtime/components/Adsbygoogle.vue
11 |    hideUnfilled,
12 |    includeQuery,
13 |  } = withDefaults(defineProps<{
   |      ^^^^^^^^^^^^
14 |    adClient?: string
15 |    adSlot?: string | null

Environment:

Nuxt Version: ^3.14.1592
Module Version: "^3.0.0",
Node Version: v20.15.0

@Kokleng-Dev
Copy link

+1

@frixou89
Copy link

Any updates on this?

@superdiazzz
Copy link

Have same issue. Any solution?

@nexoscreator
Copy link
Author

use @nuxt/scripts for Google Adseen or Google Anylists and more

@superdiazzz
Copy link

use @nuxt/scripts for Google Adseen or Google Anylists and more

Do you know how to applied Google adsense with @nuxt/scripts?

@nexoscreator

This comment has been minimized.

@nexoscreator nexoscreator linked a pull request Jan 28, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants