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

Problem with mini-css-extract-plugin #14

Open
josuelrocha opened this issue Dec 10, 2020 · 0 comments
Open

Problem with mini-css-extract-plugin #14

josuelrocha opened this issue Dec 10, 2020 · 0 comments

Comments

@josuelrocha
Copy link

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.

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

1 participant