svg-sprite-loader: Error: "request.includes is not a function"

I’m getting the following error when attempting to use this plugin:

C:\Root\Apps\@V\DebateMap\Main\node_modules\svg-sprite-loader\lib\utils.js:168
if (request && (!request.includes(spriteLoaderPath) || !rule)) {
                           ^

TypeError: request.includes is not a function
    at isModuleShouldBeExtracted (C:\Root\Apps\@V\DebateMap\Main\node_modules\svg-sprite-loader\lib\utils.js:168:28)
    at Array.filter (native)
    at Object.aggregate (C:\Root\Apps\@V\DebateMap\Main\node_modules\svg-sprite-loader\lib\utils.js:286:30)
    at Compilation.replacePlaceholdersInModules (C:\Root\Apps\@V\DebateMap\Main\node_modules\svg-sprite-loader\lib\plugin.js:35:27)
    at Compilation.applyPlugins1 (C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\node_modules\tapable\lib\Tapable.js:75:14)
    at Compilation.seal (C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\lib\Compilation.js:573:8)
    at C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\lib\Compiler.js:488:16
    at C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\node_modules\tapable\lib\Tapable.js:225:11
    at _addModuleChain (C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\lib\Compilation.js:477:11)
    at processModuleDependencies.err (C:\Root\Apps\@V\DebateMap\Main\node_modules\webpack\lib\Compilation.js:448:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[nodemon] app crashed - waiting for file changes before starting...

Here is my config: (well, the relevant part, as it is quite large)

const SpriteLoaderPlugin = require("svg-sprite-loader/plugin");
webpackConfig.plugins.push(
	new SpriteLoaderPlugin()
);
webpackConfig.module.rules.push({
	test: /\.svg$/,
	use: [
		"svg-sprite-loader",
		"svgo-loader",
	]
});

I’m using:

  • Webpack: 2.4.1
  • svg-sprite-loader: 2.0.5

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

Ah, nevermind. Everything seems to be working now. Not sure why it wasn’t before. All is well!

@steplov @Venryx @psachs21 fixed in svg-sprite-loader@3.0.2, please check