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

Issues with { cssProcessorOptions: { safe: true } } on 5.0.0 #65

Closed
lehni opened this issue Jul 17, 2018 · 4 comments
Closed

Issues with { cssProcessorOptions: { safe: true } } on 5.0.0 #65

lehni opened this issue Jul 17, 2018 · 4 comments

Comments

@lehni
Copy link

lehni commented Jul 17, 2018

I tried to update to 5.0.0, but building now throws this error:

UnhandledPromiseRejectionWarning: Error: Option safe was removed. Use parser: require("postcss-safe-parser")
    at parse (.../node_modules/postcss/lib/parse.js:18:15)
    at new LazyResult (.../node_modules/postcss/lib/lazy-result.js:70:24)
    at Processor.process (.../node_modules/postcss/lib/processor.js:117:12)
    at Function.creator.process (.../node_modules/postcss/lib/postcss.js:165:43)
    at OptimizeCssAssetsWebpackPlugin.processCss (.../node_modules/optimize-css-assets-webpack-plugin/src/index.js:62:21)
    at Object.processor (.../node_modules/optimize-css-assets-webpack-plugin/src/index.js:11:18)
    at each (.../node_modules/last-call-webpack-plugin/src/index.js:150:10)
    at arrayEach (.../node_modules/lodash/_arrayEach.js:15:9)
    at forEach (.../node_modules/lodash/forEach.js:38:10)
    at OptimizeCssAssetsWebpackPlugin.process (.../node_modules/last-call-webpack-plugin/src/index.js:147:5)
    at compilation.hooks.optimizeChunkAssets.tapPromise.chunks (.../node_modules/last-call-webpack-plugin/src/index.js:178:28)
    at _err0 (eval at create (.../node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:13:1)
    at .../node_modules/uglifyjs-webpack-plugin/dist/index.js:282:11
    at step (.../node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:90:11)
    at done (.../node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:99:22)
    at .../node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:105:15
@NMFR
Copy link
Owner

NMFR commented Jul 17, 2018

cssnano issue.

Can you try this: cssnano/cssnano#119 (comment)

@lehni
Copy link
Author

lehni commented Jul 17, 2018

Hmm but that issue is quite old, and with 4.0.2 it works as it should. I just downgraded to 4.0.2 again, and it works again, no other dependencies have changed in my project.

@NMFR
Copy link
Owner

NMFR commented Jul 17, 2018

On [email protected] we updated cssnano to v4. That's why the error is occurring.

The solution from cssnano/cssnano#119 (comment) (comment) did not work?

@jsparedes
Copy link

Maybe, the cause is relative to the difference in safe option between v3 and v4 in cssnano. One of these default changes would be the problem.

To work with [email protected]

const safeParser = require('postcss-safe-parser');

new OptimizeCssAssetsPlugin({
        cssProcessorOptions: { 
          parser: safeParser,
          discardComments: {
            removeAll: true
          }
        }
      })

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

3 participants