NuxtN
Nuxt2y ago
Tincan

Can't import the named export 'getCurrentInstance' in ./node_modules/vue-demi/lib/index.mjs

I'm trying to reverse engineer something in a nuxt 3 site for a nuxt 2 and I want to use intersectionObserver and windowSize from @vueuse/core, which I've installed version 5.3.0 which is the latest version still compatible with Vue 2.

However I get this error still

 ERROR  in ./node_modules/vue-demi/lib/index.mjs

Can't import the named export 'getCurrentInstance' from non EcmaScript module (only default export is available)


I've tried the following fix in nuxt.config.js with no success

  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.mjs$/,
          include: /node_modules/,
          type: 'javascript/auto',
        },
      ],
    },
  },
Was this page helpful?