Skip to content

Problem with mini-css-extract-plugin #14

@josuelrocha

Description

@josuelrocha

The css-sprite-loader with the latest version of mini-css-extract-plugin v1.3.x is having problems, generates the following error log:

[webpack-cli] HookWebpackError: source.replace is not a function
    at makeWebpackError (C:\...\node_modules\webpack\lib\HookWebpackError.js:49:9)
    at C:\...\node_modules\webpack\lib\Compilation.js:2018:6
    at eval (eval at create (C:\...\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at C:\...\node_modules\css-sprite-loader\src\Plugin.js:88:74
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
-- inner error --
TypeError: source.replace is not a function
    at CSSSpritePlugin.replaceHolderToString (C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:140:23)
    at C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:77:43
    at Array.forEach (<anonymous>)
    at CSSSpritePlugin.replaceInModules (C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:72:20)
    at C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:55:89
    at Hook.eval [as call] (eval at create (C:\...\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (C:\...\node_modules\webpack\node_modules\tapable\lib\Hook.js:14:14)
    at C:\...\node_modules\webpack\lib\Compilation.js:2022:33
    at eval (eval at create (C:\...\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at C:\...\node_modules\css-sprite-loader\src\Plugin.js:88:49
caused by plugins in Compilation.hooks.optimizeTree
TypeError: source.replace is not a function
    at CSSSpritePlugin.replaceHolderToString (C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:140:23)
    at C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:77:43
    at Array.forEach (<anonymous>)
    at CSSSpritePlugin.replaceInModules (C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:72:20)
    at C:\...\node_modules\base-css-image-loader\src\BasePlugin.js:55:89
    at Hook.eval [as call] (eval at create (C:\...\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (C:\...\node_modules\webpack\node_modules\tapable\lib\Hook.js:14:14)
    at C:\...\node_modules\webpack\lib\Compilation.js:2022:33
    at eval (eval at create (C:\...\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at C:\...\node_modules\css-sprite-loader\src\Plugin.js:88:49

To reproduce, just create a project with a webpack, add the css-sprite-loader and the latest version of the mini-css-extract-plugin (currently 1.3.2) and call some image inside the css with the query string "sprite".

O.S: Windows 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions