question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't used in nuxt3

See original GitHub issue

When I comment out import VueKonva from 'vue-konva' in /plugins/vuekonva.js it works But I comment in , it doesn’t work image

terminal log

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/rosie/Documents/rosie/nuxt3-app/node_modules/konva/lib/index-node.js from /Users/rosie/Documents/rosie/nuxt3-app/node_modules/vue-konva/umd/vue-konva.js not supported.
Instead change the require of index-node.js in /Users/rosie/Documents/rosie/nuxt3-app/node_modules/vue-konva/umd/vue-konva.js to a dynamic import() which is available in all CommonJS modules.
    at webpackUniversalModuleDefinition (/Users/rosie/Documents/rosie/nuxt3-app/node_modules/vue-konva/umd/vue-konva.js:7:44)
    at Object.<anonymous> (/Users/rosie/Documents/rosie/nuxt3-app/node_modules/vue-konva/umd/vue-konva.js:14:3)
    at async Promise.all (index 0)
    at async __instantiateModule__ (file:///Users/rosie/Documents/rosie/nuxt3-app/.nuxt/dist/server/server.mjs:2607:3) {
  code: 'ERR_REQUIRE_ESM'
}
[vite dev] Error loading external "/Users/rosie/Documents/rosie/nuxt3-app/node_modules/vue-konva/umd/vue-konva.js".
  at file://./.nuxt/dist/server/server.mjs:2248:291  
  at async __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:2607:3)

I tried #9 and stack overflow but it also fail

package.json

 "devDependencies": {
    "nuxt3": "latest"
  },
  "dependencies": {
    "konva": "^8.3.2",
    "vue-konva": "^2.1.7"
  }

nuxt.config.js

export default defineNuxtConfig({
    // plugins: ["~/plugins/vue-konva"],
    plugins: [
        { src: "~/plugins/vuekonva", mode: 'client' }
    ],
    build: {
        transpile: ['konva']
    },
})

/plugins/vuekonva.js

import Vue from 'vue';
import VueKonva from 'vue-konva'
Vue.use(VueKonva)

can anyone help ? thank

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
DavidVanesscommented, Mar 31, 2022

guys I can confirm vue-konva (2.1.7) works with nuxt2 and nuxt-composition api… So this is not on konva. Haven’t checked the new release yet

0reactions
vanlingcommented, Apr 6, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I access useAsyncData in a Nuxt 3 script setup tag ...
I'm using the Prismic API to get some data that I want to show in my Nuxt3 template.
Read more >
Nuxt 3 issue "Cannot read property 'resolveAlias' of undefined"
ERROR Cannot restart nuxt: Cannot read property 'resolveAlias' of undefined at Object.
Read more >
Nuxt 3 first steps. - ITNEXT
Now, during my research, I found a lot of tutorials on how to connect Nuxt 3 with new modules like i18n, Algolia, or...
Read more >
How to use Vuetify with Nuxt 3 - Cody Bontecou
Utilize the latest versions of Vuetify and Nuxt together. Installation #. Start by creating a Nuxt 3 project if you do not have...
Read more >
Nuxt 3 Tutorial Series | Part 6 | Data Fetching - YouTube
Hi all,In this video, we will see how we can have data fetching in Nuxt 3. We will see useFetch(), useAsyncData() and $fetchNuxt...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found