svgo: Segmentation fault (core dumped)

Describe the bug I upgraded SVGO from version 2.3.1 to 2.7.0 and got error Segmentation fault (core dumped). I tried multiple versions of SVGO and I’m encountering this issue only in version 2.7.0. Version 2.6.1 works fine. During upgrade process I changed my svgo.config.js from:

"use strict";

const { extendDefaultPlugins } = require("svgo");

module.exports = {
	plugins: extendDefaultPlugins([
		{
			name: "removeViewBox",
			active: false,
		},
	]),
};

To:

"use strict";

module.exports = {
	plugins: [
		{
			name: "preset-default",
			params: {
				overrides: {
					removeViewBox: false,
				},
			},
		},
	],
};

To Reproduce Steps to reproduce the behavior: I’m encountering this issue using svgo-loader for webpack. My webpack module rule:

"use strict";

module.exports = {
	// ...
	module: {
		rules: [
			// ...
			{
				test: /\.svg$/i,
				exclude: /node_modules/,
				use: [
					{
						loader: "url-loader",
						options: {
							esModule: false,
						},
					},
					"svgo-loader",
				],
			},
			// ...
		],
	},
	// ...
};

Expected behavior No errors.

Screenshots N/A

Desktop (please complete the following information):

  • SVGO Version: 2.7.0
  • NodeJs Version: 16.10.0
  • OS: Pop!_OS 20.04 LTS

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Tried to build my project a few times without any issue. If I will encounter this issue again, I will report it here. Thanks.