Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use in nuxt 3 #251

Open
odetolakehinde opened this issue Oct 8, 2024 · 3 comments
Open

Unable to use in nuxt 3 #251

odetolakehinde opened this issue Oct 8, 2024 · 3 comments

Comments

@odetolakehinde
Copy link

Error:
image

package.json

"dependencies": {
    "fabric": "^6.4.3",
    "konva": "^9.3.15",
    "nuxt": "^3.13.0",
    "vue": "latest",
    "vue-konva": "^3.1.2",
    "vue-router": "latest"
  }

plugins/konva.ts

import VueKonva from 'vue-konva';

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(VueKonva)
})

nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-04-03',
  devtools: { enabled: true },
  plugins: [{src: '~/plugins/konva.js', mode: 'client'}],
  build: {transpile: ['konva']},
})
@lavrton
Copy link
Member

lavrton commented Oct 8, 2024

Please make a small repository to reproduce.

The quick solution can be just installing canvas library: npm install canvas@next.

@odetolakehinde
Copy link
Author

here's a repo - https://github.com/odetolakehinde/nuxt-konva

this does not seem to work:

yarn add canvas@next

@odetolakehinde
Copy link
Author

cc @lavrton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants