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

Issue on React App deployment #1174

Closed
Sanyaorg opened this issue Oct 29, 2019 · 34 comments · Fixed by #1176
Closed

Issue on React App deployment #1174

Sanyaorg opened this issue Oct 29, 2019 · 34 comments · Fixed by #1176

Comments

@Sanyaorg
Copy link

Error: postcss-svgo: TypeError: Cannot set property 'multipassCount' of undefined

@larsonjj
Copy link

larsonjj commented Oct 29, 2019

Having the same issue. Looks like v1.3.1 is breaking builds.
More debug info: /node_modules/svgo/lib/svgo.js:41:37
CC @GreLI ^

@Sanyaorg
Copy link
Author

Sanyaorg commented Oct 29, 2019

Temp fix: Just rollback to "svgo": "1.3.0" (add to package.json file)

@GrimzEcho
Copy link

GrimzEcho commented Oct 29, 2019

Same -- here is the dependency graph with create-react-app

It seems like the break is from 1.3.0 --> 1.3.1, but until this is fixed either on svgo's side or with a Webpack dependency update, the easiest fix is to add a hard requirement to package.json

"dependencies":
   "svgo" : "1.3.0"

then npm install

@asherstoppard
Copy link

asherstoppard commented Oct 29, 2019

Issue's stemming from

info.multipassCount = counter;

Adding info = {} sticky plaster seems to solve the error.

@montydhanjal
Copy link

Issue's stemming from

info.multipassCount = counter;

Adding info = {} sticky plaster seems to solve the error.

// info.multipassCount = counter; info = {}

This fix does resolve my issue but I am using this as a build-in Create React App feature. As soon as i yarn install, this issue will come back. It's a temporary fix.

@GrimzEcho
Copy link

GrimzEcho commented Oct 29, 2019

Issue's stemming from

info.multipassCount = counter;

Adding info = {} sticky plaster seems to solve the error.

// info.multipassCount = counter; info = {}

This fix does resolve my issue but I am using this as a build-in Create React App feature. As soon as i yarn install, this issue will come back. It's a temporary fix.

you need to pin a specific version ... try

yarn remove svgo
yarn add [email protected]

or just manually edit your yarn.lock or package.json file

@johndevedu
Copy link

johndevedu commented Oct 29, 2019

Can anyone confirm that this fix works? Tried @BrianHVB 's solution

yarn remove svgo
yarn add [email protected]

But still getting same error.

Edit: See comment below for solution if using yarn. It works!

@dshanley
Copy link

@johndevedu I'm still getting the issue -- even with pegging the version to 1.3.0. Looking in node_modules/svgo.js where multipass is referenced, I don't see how this is still generating the error.

@kykint
Copy link

kykint commented Oct 29, 2019

Same problem while using gulp-svgmin

@johndevedu
Copy link

Yeah @dshanley looking at the commit for 1.3.0, all that's changed is the README.md and other package dependencies. Thanks for confirming.

@kykint
Copy link

kykint commented Oct 29, 2019

But with 1.3.0 everything is fine

@fmolina24
Copy link

For people using yarn add this to your package.json
"resolutions": { "svgo": "1.3.0" }

@montydhanjal
Copy link

For people using yarn add this to your package.json
"resolutions": { "svgo": "1.3.0" }

This resolved my issue. Using CRA. Thanks

@ievgenk
Copy link

ievgenk commented Oct 29, 2019

Had to do this with eslint not too long ago. The solution above works thanks!

@frolad
Copy link

frolad commented Oct 29, 2019

react-svg-loader package is also affected, temporary adding "svgo": "1.30" to the package.json works fine

@sidharthachatterjee
Copy link

Also seeing this over at https://github.com/gatsbyjs/gatsby

@rafaeldsousa
Copy link

rafaeldsousa commented Oct 29, 2019

For people using yarn add this to your package.json
"resolutions": { "svgo": "1.3.0" }

Not using yarn, but worked fine with npm
https://github.com/rogeriochaves/npm-force-resolutions

@msurguy
Copy link

msurguy commented Oct 30, 2019

Seeing this error in Vue / Nuxt.js deployments as well due to CSSNano package using SVGO

@aaronblondeau
Copy link

To get nuxt builds to work I used the "resolutions" fix from above. However, instead of using a global version of nuxt, I had to add nuxt as a dependency and run it via yarn so that it too would follow the resolutions and use the older version of svgo

yarn nuxt build

@Cherry
Copy link
Contributor

Cherry commented Oct 30, 2019

I've submitted a PR at #1176 which resolves this issue.
Until this is merged and released, as others have said, simply pin svgo to 1.3.0 or earlier.

@isjavierdiaz
Copy link

Seeing this at NextJS too.

For people using yarn add this to your package.json
"resolutions": { "svgo": "1.3.0" }

This solved the issue though.

@hhphuc12
Copy link

remove svgo and reinstall [email protected] not solved my problem

@fengerzh
Copy link

"resolutions": { "svgo": "1.3.0" }

Add this line in package.json, then rm -rf node_modules, rm -rf yarn.lock, then yarn to reinstall everything.

@gengengengengen
Copy link

"resolutions": { "svgo": "1.3.0" }

Add this line in package.json, then rm -rf node_modules, rm -rf yarn.lock, then yarn to reinstall everything.

I am using gatsby and met this problem.
The version of "svgo" is 1.3.0 and works well in my local environment but can't build when deploy to remote server (Cloud Foundry).

@johnnymillergh
Copy link

johnnymillergh commented Oct 30, 2019

Now not only this error happens during React deployment but also happens during Vue deployment. Same error message. This is how I solved this issue.

  1. Add [email protected] in dependencies, package.json

    "dependencies": {
      ...
      "svgo": "1.3.0"
    },
  2. Add following statement in package.json

    "resolutions": {
      "svgo": "1.3.0"
    }
  3. Done.

Hope this will help you guys who facing this issue as well. 😁

danymill added a commit to zebrunner/reporting-ui that referenced this issue Oct 30, 2019
@namcancode
Copy link

"resolutions": { "svgo": "1.3.0" }
done

@Gastonite
Copy link

multipass

Mosharush added a commit to Mosharush/svgo that referenced this issue Oct 30, 2019
Error: postcss-svgo: TypeError: Cannot set property 'multipassCount' of undefined
eg: svg#1174
@rakibtg
Copy link

rakibtg commented Oct 30, 2019

BZeYaKO

a-a-hofmann added a commit to mp-access/Frontend that referenced this issue Oct 30, 2019
Failed to compile.

postcss-svgo: TypeError: Cannot set property 'multipassCount' of undefined

See svg/svgo#1174
jmclaus pushed a commit to mitocw/ocw-pwa-beta that referenced this issue Oct 30, 2019
* Pin svgo version at 1.3.0 until fix is issued:
  svg/svgo#1174
@abdennour
Copy link

abdennour commented Oct 30, 2019

Oops! What's a nightmare you did guys 😭
But fixed...😄!
I am DevOps release engineer designing CI/CD of a lot projects.
This means I have the responsibility to fix all pipelines, namely frontend apps pipelines....
Happy it works and thanks for the author of this #1174 (comment) comment

@SecondeJK
Copy link

For Nuxt 2:
pushing svgo down to 1.3.0 via resolutions doesn't result in a build.

Now getting:
Error: Cannot find module 'css-tree'
instead.

@jantimon
Copy link

@SecondeJK you don't have to revert svgo to 1.3.0 anymore - your error is probably unrelated

@SecondeJK
Copy link

@jantimon thanks - realised it's because I last pulled node modules when it was still a problem. Deleted lock, reinstalled, Nuxt happy with building.

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

Successfully merging a pull request may close this issue.