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

Optimize is not a function #80

Closed
christopher-harris opened this issue Mar 2, 2022 · 3 comments
Closed

Optimize is not a function #80

christopher-harris opened this issue Mar 2, 2022 · 3 comments

Comments

@christopher-harris
Copy link

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
[X] Documentation issue or request
[X] Support request
[ ] Other... Please describe:

Current behavior

Running through the installation and setup instructions in the Readme and keep running into an error when running the npm run generate-icons script. Here is the error:

/node_modules/@ngneat/svg-generator/tree.js:49
svgContent: (0, svgo_1.optimize)(svgContent, { plugins, path: svgPath }).data,
^

TypeError: (0 , svgo_1.optimize) is not a function

Expected behavior

Expected this to work and actually generate the svg ts files.

Minimal reproduction of the problem with instructions

Created a fresh vanilla Angular application and then ran the ng add @ngneat/svg-icon. New scripts were added in package.json. Double checked against the documentation to make sure they were correct. Ran npm run generate-icons and get the error.

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: XX  
- Platform:  

Others:

@JrPribs
Copy link

JrPribs commented Mar 3, 2022

@christopher-harris I was also just having this issue. try installing the latest svg-generator, I installed it both globally and normally not sure which one did it I assume the global install, I'd say try normal install see if that fixes & if not global should do it. @NetanelBasal can confirm possibly?

npm i @ngneat/svg-generator@latest
and/or
npm i -G @ngneat/svg-generator@latest

I think this may be missing from the ng add script or maybe just should be added to the readme

@NetanelBasal
Copy link
Member

Yes, seems like you're using an old version of svgo.

@christopher-harris
Copy link
Author

@JrPribs that seems to have worked...thank you.

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

3 participants