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

Exception emitted for every svg #487

Open
thany opened this issue Jun 3, 2022 · 0 comments
Open

Exception emitted for every svg #487

thany opened this issue Jun 3, 2022 · 0 comments

Comments

@thany
Copy link

thany commented Jun 3, 2022

Do you want to request a feature, report a bug or ask a question?
Bug

What is the current behavior?

WARNING in ./src/svg/icon-cart.svg
Module Warning (from ./node_modules/svg-sprite-loader/lib/loader.js):
svg-sprite-loader exception. Some loaders will be applied after svg-sprite-loader in extract mode
 @ ./src/svg/sprite.js 3:0-26

What is the expected behavior?
No warning. It works, so why complain?

If the current behavior is a bug, please provide the steps to reproduce, at least part of webpack config with loader configuration and piece of your code.

Piece of webpack config might be relevant:

{
        test: /\.svg$/,
        include: [path.resolve(__dirname, 'src/svg')],
        use: [
          {
            loader: 'svg-sprite-loader',
            options: {
              extract: true,
              spriteFilename: 'svg/renewi.sprite.svg'
            }
          },
        ]
      }

Another issue on this mentioned:

Review your webpack config and check that svg-sprite-loader is the latest applied loader to SVGs.

Not sure if this means latest version or last entry but it is both. So that is NOT the solution.

This is especially weird because in your loader.js, it goes:

if (loaderIndex > 0) {
  this.emitWarning(new Exceptions.RemainingLoadersInExtractModeException());
}

This suggests it wants to be the FIRST entry, not the last (or latest)... But even so, why is this made into a problem in the first place? Why does this plugin need to complain about its position in the configuration??

Please tell us about your environment:

  • Node.js version: 10.16.3
  • webpack version: 4.16.5
  • svg-sprite-loader version: 4.2.1 ~ 6.0.0
  • OS type & version: Windows 10 21H2
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

1 participant