Viewer JS in Vue 3

196 views Asked by At

I have been trying to use this package called: https://github.com/mirari/v-viewer/tree/v3 for the past weeks but to no avail. The Viewer Vue package does not work for Vue latest (V3).

I have followed the instructions meticulously but it does not work

Especially the CSS file does not load.

I'm using Nuxt, I added it in the config file, but I still got an error that the file does not exist.

export default defineNuxtConfig({
  // import styles
  css: ['@/assets/styles/main.scss', 'viewerjs/dist/viewer.css'],
  devtools: { enabled: true },
  // enable takeover mode
  typescript: { shim: false },
  build: { transpile: ['vuetify'] },
  modules: [
    (_options, nuxt) => {
      nuxt.hooks.hook('vite:extendConfig', (config) => {
        config?.plugins?.push(vuetify({ autoImport: true }));
      });
    },
  ],

I also added it in my CSS global styles, but I still could not compile it by NUXT.

[error] Nuxt Build Error: [vite]: Rollup failed to resolve import "viewerjs/dist/viewer.css" from "virtual:nuxt:/vercel/path0/.nuxt/css.mjs".

I don't know what is going on.

0

There are 0 answers