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

nuxt3 support #69

Open
ganiipek opened this issue Jul 18, 2024 · 1 comment
Open

nuxt3 support #69

ganiipek opened this issue Jul 18, 2024 · 1 comment

Comments

@ganiipek
Copy link

ganiipek commented Jul 18, 2024

I am developing an application for Nuxt 3. Vuefinder works with both frontend and backend api. But when I import it as vuefinder as plugin, I get an error.

plugins/vue-finder.ts

import "vuefinder/dist/style.css";
import VueFinder from "vuefinder/dist/vuefinder";

export default defineNuxtPlugin(async (nuxtApp) => {
  nuxtApp.vueApp.component("vue-finder", VueFinder);
});

Error:
require() of ES Module C:\Users\x-pt1\Desktop\programlar\vuefinder-nuxt3\node_modules@uppy\core\lib\index.js from C:\Users\x-pt1\Desktop\programlar\vuefinder-nuxt3\node_modules\vuefinder\dist\vuefinder.cjs not supported. Instead change the require of index.js in C:\Users\x-pt1\Desktop\programlar\vuefinder-nuxt3\node_modules\vuefinder\dist\vuefinder.cjs to a dynamic import() which is available in all CommonJS modules.

@chupacabramiamor
Copy link

chupacabramiamor commented Aug 4, 2024

Try this:

import VueFinder from 'vuefinder/dist/vuefinder';

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

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