arash16 / nuxt-ssr-cache

Cache middleware for nuxt's SSR rendering.
MIT License
295 stars 64 forks source link

ERROR Cannot redefine property: styles #49

Closed storageddd closed 2 years ago

storageddd commented 2 years ago

Hi! I faced with error "ERROR Cannot redefine property: styles" when nuxt-ssr-cache module is included in nuxt.config.js. Maybe I doing something wrong, cuz this problem has not issues.

nuxt version 2.15.8. nuxt-ssr-cache version 1.5.2.

My config:

cache: {
      version: pkg.version,
      pages: [
        /^\/$/,
        '/main'
      ],
      key(route, context) {
        const hostname = context.req.headers.host || context.req.headers['x-forwarded-host'];
        if (!hostname) {
          return null;
        }
        return hostname ? path.join(hostname, route) : route;
      },
      store: {
        type: 'memory',
        max: 100,
        ttl: 600
      }
 },
storageddd commented 2 years ago

Problem was in out backend. It redirect all requests from SSR. And SPA were crashed.