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

Parcel build fails - @parcel/optimizer-svgo - "Autoinstall is disabled, please install this package manually and restart Parcel." #10080

Open
basher opened this issue Jan 31, 2025 · 6 comments

Comments

@basher
Copy link

basher commented Jan 31, 2025

🐛 bug report

I'm trying to publish a Storybook/HTML component library that uses Parcel to bundle CSS/JS/image assets.

Github Pages build fails - see error:
https://github.com/theThought/Transform-v2/actions/runs/13072020838/job/36475528341#step:4:56

Error screenshot:
Image

Local build is OK.

🎛 Configuration (.babelrc, package.json, cli command)

"build": "npm install && npm run build:parcel",
"build:parcel": "parcel build index.html --dist-dir public/build",
"build-storybook": "storybook build",
"publish-storybook": "npm run build && npm run build-storybook",

🤔 Expected Behavior

Parcel SVGO optimiser should be automatically installed as a dependency.

😯 Current Behavior

SVGO not installed in Github Pages Build process, but it does install if I run the npm run publish-storybook command locally.

I also tried explicitly installing SVGO as a DevDependency, but got the same error.

🔦 Context

I'm unable to publish Storybook because of this issue.

💻 Code Sample

See links provided above.

🌍 Your Environment

Software Version(s)
Parcel 2.13.2
Node 20.11.0
npm/Yarn npm 10.2.4
Operating System Windows (local)
@basher basher changed the title Github Pages Parcel build fails - @parcel/optimizer-svgo - "Autoinstall is disabled, please install this package manually and restart Parcel." Parcel build fails - @parcel/optimizer-svgo - "Autoinstall is disabled, please install this package manually and restart Parcel." Jan 31, 2025
@basher
Copy link
Author

basher commented Feb 3, 2025

I rolled back Parcel to v2.12.0 which fixed my issue, as adding SVGO as a DevDependency did NOT work for me.

Ref: related PR see #9969

@basher basher closed this as completed Feb 3, 2025
@basher
Copy link
Author

basher commented Mar 4, 2025

I need to re-open this issue.

The suggested "fix" to install SVGO as a devDependency does not work for the project I'm working on- #9969 (comment)

We're trying to fix a separate issue with not being able to set JS breakpoints with map files (generated by Parcel build), so we needed to "bump" Parcel to see if the problem was resolved... unfortunately, it broke our build!

@basher basher reopened this Mar 4, 2025
@devongovett
Copy link
Member

Why doesn't installing svgo work for you?

@basher
Copy link
Author

basher commented Mar 4, 2025

@devongovett I have no idea!

I've now re-instated [email protected] and SVGO in this commit:
theThought/Transform-v2@75759e1

Github Pages build fails:
https://github.com/theThought/Transform-v2/actions/runs/13661888280/job/38194721999#step:4:56

Also, please note that my LOCAL BUILD ALSO FAILS when running this build command - https://github.com/theThought/Transform-v2/blob/master/UI/package.json#L26 - contrary to what I said above in original bug report. Now it's the @parcel/package-manager failing.

See attached screenshot:

Image


We need to bump Parcel & TypeScript to try and resolve an issue we're having with debugging production JavaScript using debugger in devtools, with the minified JS and map files.

@devongovett
Copy link
Member

Did you follow the recommendation in the error message to run your package manager (eg npm)?

@basher
Copy link
Author

basher commented Mar 5, 2025

Yes... assuming the error message means running an install of Node dependencies.

The build process currently looks like this:

"prebuild": "rm -rf .parcel-cache && rm -rf public/build",
"build": "npm install && cross-env NODE_ENV=production && npm run build:parcel",
"build:parcel": "parcel build index.html --dist-dir public/build --cache-dir .parcel-cache",

And project dependencies (simplified):

"devDependencies": {
        "parcel": "^2.13.3",
        "svgo": "^3.3.2",
}

I still get the same build error, even if I delete node_modules folder first.


We'll have to revert back to [email protected] so we can run builds.

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

2 participants