dulnan / nuxt-multi-cache

Advanced caching of components, routes and data for Nuxt 3. Dynamically define CDN cache control headers. Provides cache management API for purging items by key or using cache tags.
https://nuxt-multi-cache.dulnan.net
MIT License
184 stars 15 forks source link

Hangs after build with module @nuxt/content #29

Open unluckynelson opened 8 months ago

unluckynelson commented 8 months ago

Edit: Reproduced with a new nuxt app, it seems that when nuxt-multi-cache@3.1.1 is installed with @nuxt/content@2.8.5 then the build hangs

As it says, hangs after ✔ You can preview this build using node .output/server/index.mjs which prevents my build pipelines from completing. But works fine during dev

Nuxi info:

- Operating System: `Linux`
- Node Version:     `v18.17.1`
- Nuxt Version:     `3.7.4`
- CLI Version:      `3.9.0`
- Nitro Version:    `2.6.3`
- Package Manager:  `npm@9.6.7`
- Builder:          `-`
- User Config:      `devtools`, `ssr`, `modules`, `multiCache`, `i18n`, `build`, `nitro`, `loading`, `app`, `content`, `server`, `runtimeConfig`, `delayHydration`, `image`, `css`, `tailwindcss`, `postcss`, `vite`
- Runtime Modules:  `nuxt-graphql-client@0.2.30`, `@nuxtjs/tailwindcss@6.4.1`, `@nuxtjs/device@3.1.0`, `nuxt-schema-org@2.1.2`, `@nuxtjs/i18n@8.0.0-rc.5`, `@nuxt/content@2.7.0`, `nuxt-swiper@1.2.2`, `@pinia/nuxt@0.4.7`, `@pinia-plugin-persistedstate/nuxt@1.1.1`, `nuxt-multi-cache@3.1.1`
- Build Modules:    `-`

my nuxt.config:

export default defineNuxtConfig({
  devtools: {
    enabled: true,

    timeline: {
      enabled: true,
    },
  },

  ssr: true,

  modules: [
    "nuxt-graphql-client",
    "@nuxtjs/tailwindcss",
    "@nuxtjs/device",
    "nuxt-schema-org",
    "@nuxtjs/i18n",
    "@nuxt/content",
    "nuxt-swiper",
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
    "nuxt-multi-cache"
  ],

  multiCache: {
    component: {
      enabled: true,
    },
    data: {
      enabled: true,
    },
    route: {
      enabled: true,
    },
    // Purge or inspect api [read more](https://nuxt-multi-cache.dulnan.net/features/api)
    api: {
      enabled: process.env.VIATU_ENV !== 'prod',
      prefix: '/__cache',
      authorization: false,
      cacheTagInvalidationDelay: 60000
    },
    debug: true
  },
});

My multiCache.serverOptions.ts

export default defineMultiCacheOptions({
  data: {
    storage: {
      driver: redisDriver({
        base: 'data:',
        host: process.env.CACHE_HOST,
        port: parseInt(process.env.CACHE_PORT ? process.env.CACHE_PORT : '6379'),
      }),
    },
  },

  component: {
    storage: {
      driver: redisDriver({
        base: 'component:',
        host: process.env.CACHE_HOST,
        port: parseInt(process.env.CACHE_PORT ? process.env.CACHE_PORT : '6379'),
      }),
    },
  },
  route: {
    storage: {
      driver: redisDriver({
        base: 'route:',
        host: process.env.CACHE_HOST,
        port: parseInt(process.env.CACHE_PORT ? process.env.CACHE_PORT : '6379'),
      }),
    }
  },
})
dulnan commented 2 weeks ago

Did you ever manage to make it work or is this still broken?