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

SVG ?include does not work anymore #328

Open
MattCCC opened this issue Jul 24, 2021 · 1 comment
Open

SVG ?include does not work anymore #328

MattCCC opened this issue Jul 24, 2021 · 1 comment

Comments

@MattCCC
Copy link

MattCCC commented Jul 24, 2021

Hello, firstly thank you for a great plugin! I really appreciate your work especially if it comes it svg loader and optimizations. It seems like svg ?include for inlining svgs doesn't work anymore in latest nuxt 2.15.7. I use follow config:

  optimizedImages: {
    optimizeImages: true,
    imagesName: ({ isDevMode }) =>
      isDevMode ? "[path][name][hash:optimized].[ext]" : "[path][name].[ext]",
    webp: {
      preset: "default",
      quality: 50,
    },
  },

This is what I get when I try to require an SVG:

ERROR in ./static/svg ?include sync ^\.\/.*\.svg$
Module not found: Error: Can't resolve 'img-loader' in '/path_cut'
 @ ./static/svg ?include sync ^\.\/.*\.svg$
 @ ./utils/svg-renderer.js
 @ ./node_modules/babel-loader/lib??ref--16-0!./node_modules/ts-loader??ref--16-1!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=script&lang=ts&
 @ ./pages/index.vue?vue&type=script&lang=ts&
 @ ./pages/index.vue
 @ ./.nuxt/router.js
 @ ./.nuxt/index.js
 @ ./.nuxt/server.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/server.js

@MattCCC MattCCC changed the title SVG ?inline does not work anymore SVG ?include does not work anymore Jul 24, 2021
@dfl-zeke
Copy link

This issue still persists. Have you found any way to avoid this error?

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