Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Without `from` option PostCSS could generate wrong source map or do not find Browserslist config

Tags:

Witout from option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to undefined to prevent this warning

ionic3 project, when I running ionic corodva bulid ios --prod showing this warning for me.

ionic info

cli packages: (/usr/local/lib/node_modules)      @ionic/cli-utils  : 1.19.0     ionic (Ionic CLI) : 3.19.0  global packages:      cordova (Cordova CLI) : 7.1.0   local packages:      @ionic/app-scripts : 3.1.7     Cordova Platforms  : android 6.3.0 ios 4.4.0     Ionic Framework    : ionic-angular 3.9.2  System:      ios-deploy : 1.9.2      Node       : v6.11.3     npm        : 3.10.10      OS         : macOS Sierra     Xcode      : Xcode 9.2 Build version 9C40b   Environment Variables:      ANDROID_HOME : not set  Misc:      backend : pro 

UPDATE:

I tried to update my npm to 5.5.1 and node to 8.6.0, but still showing.

like image 737
Yuyang He Avatar asked Jan 09 '18 06:01

Yuyang He


2 Answers

Finally, this warning solved. Thanks to Suraj Rao

First find sass.js file under /node_modules/@ionic/app-scripts/dist/sass.js. inside search var postcssOptions and add from: undefined,

Finally should be like this:

var postcssOptions = {             from: undefined,             to: path_1.basename(sassConfig.outFile),             map: autoPrefixerMapOptions         }; 

Reference: workaround.

like image 104
Yuyang He Avatar answered Sep 23 '22 09:09

Yuyang He


For whoever directly used PostCSS and met this issue then came here, Change your

postcss( any_plugins ).process( css ) 

to

postcss( any_plugins ).process( css, { from: undefined } ) 

can fix the issue.

like image 26
harrrrrrry Avatar answered Sep 20 '22 09:09

harrrrrrry