Skip to content

Class constructor LRUCache cannot be invoked without 'new'  #4242

@regenrek

Description

@regenrek

Current behavior

When starting a fresh vue-storefront 1.11.2 project it fails because of

Class constructor LRUCache cannot be invoked without 'new'

Can you handle fixing this bug by yourself?

  • [X ] YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

Environment details

  • OS: Mac OSX
  • Node: 12.4
  • Code Version: master / Vue Storefront 1.11.2

Possible fix

  • Update Code in ssr-renderer.js
function createRenderer (bundle, clientManifest, template) {
  const cache = require('lru-cache');

  // https://github.com/vuejs/vue/blob/dev/packages/vue-server-renderer/README.md#why-use-bundlerenderer
  return require('vue-server-renderer').createBundleRenderer(bundle, {
    clientManifest,
    // runInNewContext: false,
    cache: new cache({
      max: 1000,
      maxAge: 1000 * 60 * 15
    })
  })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: NormalPriority mark - normal prioritybugBug reports

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions