ionic-framework: PostCSS could generate wrong source map error
Ionic version: (check one with “x”) (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [x] 3.x [ ] 4.x
I’m submitting a … (check one with “x”) [x] bug report [ ] feature request
Please do not submit support requests or “How to” questions here. Instead, please use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior: If we build a new app using your blank starter or any other template building the android app we are running into this error
[16:52:18] sass started ...
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
[16:52:19] sass finished in 1.13 s
Expected behavior: The bug message should not be
Steps to reproduce:
Create a new blank app using
ionic start postcss
build the android app doing
ionic cordova build android
and you can see log with the warn or error message
[16:57:54] sass started ...
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
[16:57:55] sass finished in 793 ms
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
cli packages: (/usr/lib/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.6
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.9.4
npm : 5.6.0
OS : Linux 4.13
Environment Variables:
ANDROID_HOME : /abcdef/android/sdk
Misc:
backend : legacy
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 47
- Comments: 27
Commits related to this issue
- Remove PostCSS warning This removes following warning: Remove warning: Without `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or ... — committed to StefanRein/ionic-app-scripts by StefanRein 6 years ago
- fix(sass): remove PostCSS warning (#1364) This removes following warning: Remove warning: Without `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it t... — committed to ionic-team/ionic-app-scripts by StefanRein 6 years ago
Until this is fixed, one possibility is to revert back some patches before the error was introduced:
npm i -D -E postcss@6.0.14CHANGELOG.md of PostCSS
https://github.com/postcss/postcss/blame/master/lib/lazy-result.es6#L192
In the: package.json of ionic-app-scripts this
"postcss": "^6.0.13"installs also the new patch6.0.15, which has the new warning.find sass.js file. under /node_modules/@ionic/app-scripts/dist/sass.js. find var postcssOptions and add from: undefined,
Finally should be like this: var postcssOptions = { from: undefined, to: path_1.basename(sassConfig.outFile), map: autoPrefixerMapOptions };
@thezakman Not yet. The issue is open. The warning still exists.
Please stop. This is not helping in any way. This is an open source project. If the people have time, they will fix it. There are solutions mentioned above to fix the warning.
Though I don’t want to speak on behalf of the IONIC team, I feel like something needs to be said here:
This issue doesn’t get closer to resolution in proportion to the number of comments that say “This warning still appears.” / “Any update on this” / “Any fix for this” / etc.
If you’re stuck, read the thread – there’s a workaround, which as the name suggests, will get you working. If you’d like to get updates on this, save some keystrokes by clicking the ‘Subscribe’ button – that allows you to receive updates in your e-mail. You’ll also receive updates every time someone comments “Any update on this?”, so please, don’t be that person.
This warning still apears.
I found this Workaround
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 };
https://stackoverflow.com/questions/48162738/without-from-option-postcss-could-generate-wrong-source-map-or-do-not-find-bro
This warning still apears.
This warning still appears.
This warning still apears.
https://github.com/ionic-team/ionic-app-scripts/pull/1364#issuecomment-358557878
Please use the suggestion above for now.
@jhonnhenry dude, seriously? We know - the issue is still open. Just subscribe and be on your way…
If you insist on leaving a comment, help us be more productive by providing some insight like what versions you’re running.
Still got his warning. Jumping into node_modules is no serious :😕
i solve problem using this ( thanx also to @AlbenJohn) https://stackoverflow.com/a/48315414