jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
557 stars 59 forks source link

vite svg loader with typescript gives error when running jest test #27

Closed ahyagoub40 closed 1 year ago

ahyagoub40 commented 2 years ago
    Configuration error:

    Could not locate module @assets/images/icon-calendar.svg?component mapped as:
    /Users/ahmedyagoub/plankk/phoenix/src/assets/$1.

    Please check your configuration for these entries:
    {
      "moduleNameMapper": {
        "/@assets\/(.*)/": "/Users/ahmedyagoub/plankk/phoenix/src/assets/$1"
      },
      "resolver": undefined
    }
jpkleemans commented 2 years ago

Hi, thanks for reporting. Could you maybe share your project (or a test project) so I can reproduce this error, and investigate how to resolve it.

ahyagoub40 commented 2 years ago

How would you map it in Jest I am using the svg loader in vue with typescript project, the way it is described in the readme, when i run my tests, I get that message

jpkleemans commented 2 years ago

Hi, have you tried the steps in https://github.com/jpkleemans/vite-svg-loader/issues/35?

jpkleemans commented 1 year ago

Closed after 60 days of inactivity