ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

Plugin name should be specified #53

Closed danielehrhardt closed 3 years ago

danielehrhardt commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

yarn run v1.22.11
$ svg-generator
C:\Projekte\web-app\node_modules\svgo\lib\svgo\config.js:113
      throw Error(`Plugin name should be specified`);
      ^

Error: Plugin name should be specified
    at resolvePluginConfig (C:\Projekte\web-app\node_modules\svgo\lib\svgo\config.js:113:13)
    at Array.map (<anonymous>)
    at Object.optimize (C:\Projekte\web-app\node_modules\svgo\lib\svgo.js:45:37)
    at Object.createTree (C:\Projekte\web-app\node_modules\@ngneat\svg-generator\tree.js:49:40)
    at Object.generateSVGIcons (C:\Projekte\web-app\node_modules\@ngneat\svg-generator\generator.js:19:32)
    at Object.<anonymous> (C:\Projekte\web-app\node_modules\@ngneat\svg-generator\index.js:9:13)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: v14.17.0
- Platform:  windows

Others:

NetanelBasal commented 3 years ago

Do you have a config file?

danielehrhardt commented 3 years ago

Do you have a config file?

I only have the following in the package.json like in your documentation:

 "svgGenerator": {
    "outputPath": "./src/app/svg",
    "prefix": "app",
    "srcPath": "./src/assets/svg",
    "svgoConfig": {
      "plugins": [
        "removeDimensions"
      ]
    }
  }
NetanelBasal commented 3 years ago

Works for me. Can you try npx @ngneat/svg-generator@latest svg-generator?

danielehrhardt commented 3 years ago

Somehow, it does work now.

FrEaKmAn commented 2 years ago

I have same issue, running npx @ngneat/svg-generator@latest svg-generator outputs Plugin name should be specified