legeneek / nuxt-cache-module

nuxt page cache module
8 stars 0 forks source link

Cannot read properties of undefined (reading 'hook') #2

Open unluckynelson opened 1 year ago

unluckynelson commented 1 year ago

It seems like this.nuxt is not defined at cacheRenderer (node_modules/nuxt-cache-module/src/index.js:23:13)

Using Nuxt 3.5

"devDependencies": {
    "@apollo/client": "^3.7.12",
    "@graphql-codegen/cli": "^3.3.1",
    "@graphql-codegen/typescript": "^3.0.4",
    "@graphql-codegen/typescript-operations": "^3.0.4",
    "@nuxt/content": "^2.4.3",
    "@nuxt/image-edge": "^1.0.0-27954023.4cee565",
    "@nuxtjs/device": "^3.1.0",
    "@nuxtjs/google-fonts": "^2.0.0",
    "@nuxtjs/tailwindcss": "^6.4.1",
    "@nuxtjs/web-vitals": "^0.2.2",
    "@tailwindcss/line-clamp": "^0.4.2",
    "@types/lodash.uniqby": "^4.7.7",
    "@vue/apollo-composable": "^4.0.0-beta.4",
    "autoprefixer": "^10.4.13",
    "graphql": "^16.6.0",
    "js-yaml-loader": "^1.2.2",
    "nuxt": "^3.5.2",
    "nuxt-delay-hydration": "^1.1.4",
    "nuxt-schema-org": "^2.1.2",
    "nuxt-seo-kit": "^1.3.1",
    "postcss": "^8.4.21",
    "postcss-nesting": "^11.2.2",
    "sass": "^1.58.3",
    "tailwindcss": "^3.3.0",
    "vite-svg-loader": "^4.0.0"
  },
  "dependencies": {
    "@gtm-support/vue-gtm": "^2.0.0",
    "@morev/vue-transitions": "^2.3.6",
    "@nuxtjs/apollo": "^5.0.0-alpha.6",
    "@nuxtjs/i18n": "^8.0.0-beta.10",
    "@pinia-plugin-persistedstate/nuxt": "^1.1.1",
    "@pinia/nuxt": "^0.4.7",
    "@vueuse/components": "^10.1.2",
    "@vueuse/nuxt": "^10.1.2",
    "body-scroll-lock": "^4.0.0-beta.0",
    "cross-fetch": "^3.1.6",
    "date-fns": "^2.30.0",
    "fast-fuzzy": "^1.12.0",
    "gqlmin": "^0.1.1",
    "hooper-vue3": "^0.4.5",
    "lodash.capitalize": "^4.2.1",
    "lodash.debounce": "^4.0.8",
    "lodash.difference": "^4.5.0",
    "lodash.intersection": "^4.4.0",
    "lodash.kebabcase": "^4.1.1",
    "lodash.min": "^4.0.1",
    "lodash.uniqby": "^4.7.0",
    "mapbox-gl": "^2.13.0",
    "multi-range-slider-vue": "^1.1.4",
    "nuxt-cache-module": "^2.0.0",
    "nuxt-swiper": "^1.1.0",
    "pinia": "^2.0.33",
    "postcss-import": "^15.1.0",
    "postcss-nested": "^6.0.1",
    "prettier": "^2.8.7",
    "vue-multiselect": "^3.0.0-beta.1"
  }
legeneek commented 1 year ago

This module was developed for Nuxt 2. In Nuxt 3.5 you can try Nitro's cache api [https://nitro.unjs.io/guide/cache]() which is still experimental or create a Nitro plugin and use hooks to implement the page cache