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

Error when minimize big svg #1411

Closed
MarcoCivettini opened this issue Mar 9, 2021 · 2 comments
Closed

Error when minimize big svg #1411

MarcoCivettini opened this issue Mar 9, 2021 · 2 comments
Labels

Comments

@MarcoCivettini
Copy link

Describe the bug
Hi,
I've try to minimize a big svg (65MB)
but after a lot of time the svgo was not compressed and return me this error.

Someone can help me?

RangeError: Maximum call stack size exceeded at JSAPI.spliceContent (C:\temp\prova\node_modules\svgo\lib\svgo\jsAPI.js:13 0:30) at C:\temp\prova\node_modules\svgo\plugins\collapseGroups.js:81:26 at Array.forEach (<anonymous>) at Object.exports.fn (C:\temp\prova\node_modules\svgo\plugins\collapseGroups .js:45:22) at C:\temp\prova\node_modules\svgo\lib\svgo\plugins.js:65:37 at Array.filter (<anonymous>) at monkeys (C:\temp\prova\node_modules\svgo\lib\svgo\plugins.js:53:35) at perItem (C:\temp\prova\node_modules\svgo\lib\svgo\plugins.js:81:10) at module.exports (C:\temp\prova\node_modules\svgo\lib\svgo\plugins.js:32:16 ) at optimize (C:\temp\prova\node_modules\svgo\lib\svgo.js:58:13)

Screenshots
Immagine 2021-03-09 080140

Desktop (please complete the following information):

  • SVGO Version [2.2.1]
  • NodeJs Version [e.g 14.15.1]
  • OS: [Windows 10]

Additional context
If i try with a smaller image like 15MB the procedure run correctly without any error message

@TrySound
Copy link
Member

TrySound commented Mar 9, 2021

Hi! SVGO is not designed to process so big images. Though you can try to extend memory limit in node

NODE_OPTIONS="--max_old_space_size=4096" svgo ...

This will work for linux or mac os. Not sure how to set environment variable in windows.

@TrySound TrySound closed this as completed Mar 9, 2021
@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 9, 2021

See #954 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants