Closed yosefeliezrie closed 4 months ago
When you add the generateComposables: {enabled: true} to 'wpNuxt' section for your nuxt.config.ts you get the following error
generateComposables: {enabled: true}
Object literal may only specify known properties, and 'enabled' does not exist in type '{ prefix: string; async: boolean; }'.ts(2353)
Currently using WPNuxt
{ "name": "wpnuxt-demo", "version": "0.1.0", "private": true, "scripts": { "dev": "nuxt dev", "build": "nuxt build", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", "start": "nuxt start" }, "devDependencies": { "@iconify-json/mdi": "^1.1.67", "@nuxt/image": "^1.7.0", "@nuxt/ui-pro": "^1.3.0", "@nuxtjs/plausible": "^1.0.0", "@vernaillen/wpnuxt": "0.5.0-edge.0", "@vueuse/core": "^10.11.0", "nuxt": "^3.12.2", "nuxt-time": "^0.1.3" }, "dependencies": { "vue-easy-lightbox": "^1.19.0", "vue-json-pretty": "^2.4.0" }, "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a" }
// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ experimental: { viewTransition: true }, extends: ['@nuxt/ui-pro'], modules: [ '@nuxt/image', '@nuxt/ui', '@nuxtjs/plausible', '@vernaillen/wpnuxt', 'nuxt-time', ], future: { compatibilityVersion: 4 }, // https://wpnuxt.com/getting-started/installation wpNuxt: { wordpressUrl: 'https://wordpress.wpnuxt.com', frontendUrl: 'https://demo.wpnuxt.com', defaultMenuName: 'main', blocks: true, showBlockInfo: false, enableCache: true, staging: false, logLevel: 4, downloadSchema: true, generateComposables: { enabled: true, } }, css: [ 'vue-json-pretty/lib/styles.css' ], image: { provider: 'twicpics', twicpics: { baseURL: 'https://vernaillen.twic.pics/wpnuxt-demo' } }, colorMode: { preference: 'dark' }, ui: { icons: ['mdi'] }, routeRules: { '/**': { prerender: true, } }, plausible: { apiHost: 'https://demo.wpnuxt.com/plio' }, devtools: { enabled: true } })
Can you try if you still get the error when you use wpnuxt 0.5.1? It's a patch version which enables the generated composables by default and should also fix the type error.
resolved in 0.5.1
Issue
When you add the
generateComposables: {enabled: true}
to 'wpNuxt' section for your nuxt.config.ts you get the following errorObject literal may only specify known properties, and 'enabled' does not exist in type '{ prefix: string; async: boolean; }'.ts(2353)
Currently using WPNuxt
Current package.json
Current nuxt.config.ts (Based on Current Version of WPNuxt-Demo Repo