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

PostCSS could generate wrong source map error #13763

Closed
mburger81 opened this issue Jan 4, 2018 · 27 comments
Closed

PostCSS could generate wrong source map error #13763

mburger81 opened this issue Jan 4, 2018 · 27 comments
Labels
ionitron: v3 moves the issue to the ionic-v3 repository

Comments

@mburger81
Copy link
Contributor

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
StefanRein added a commit to StefanRein/ionic-app-scripts that referenced this issue Jan 9, 2018
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 to `undefined` to prevent this warning

`from: the input file name (most runners set it automatically).`
Source: https://github.com/postcss/postcss

Fixes ionic-team#1359 #13763
ionic-team#1359
ionic-team/ionic-framework#13763
@StefanRein
Copy link

StefanRein commented Jan 9, 2018

As the warning says:

Without 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

I added the field from and did set it to undefined and created a pull request.

https://github.com/StefanRein/ionic-app-scripts/blob/29873ae96611ae209ca4b065fd9940d6b7b96bda/src/sass.ts#L285

This resolves this warning. But I don't know if this has further consequences and the Ionic Team needs to fill in there a path to the generated css file or something like that.

@danbucholtz Could you review this please? Our automated builds are failing because of this.
(The "warning" is interpreted as an error..)

Edit: PostCSS uses ultimately console.warn, but this goes on node to the stderr pipe and our TeamFS fails.

stderr is used for warning or error output. Source

@StefanRein
Copy link

StefanRein commented Jan 9, 2018

Until this is fixed, one possibility is to revert back some patches before the error was introduced:

npm i -D -E [email protected]

CHANGELOG.md of PostCSS

6.0.16
Fix warning text (by Michael Keller).
6.0.15
Add warning about missed from option on process().then() call.
Add IE 10 support.

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 patch 6.0.15, which has the new warning.

@thezakman
Copy link

was this fixed?

@StefanRein
Copy link

@thezakman Not yet. The issue is open. The warning still exists.

@AlbenJohn
Copy link

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
};

@StefanRein
Copy link

StefanRein commented Jan 20, 2018

ionic-team/ionic-app-scripts#1364 (comment)

You should not modify any files in the node_modules directory. If you update packages, reinstall them, installing them in a new project, any modifications are gone.

Please use the suggestion above for now.

@hanifmazlan
Copy link

i solve problem using this ( thanx also to @AlbenJohn)
https://stackoverflow.com/a/48315414

@polfernandez
Copy link

Any fix on this?

@johnroper100
Copy link

While it is not breaking my builds, this warning appears for me as well. This is a one line quick fix, is there already a pull request for this?

@StefanRein
Copy link

StefanRein commented Feb 25, 2018

@johnroper100 Yes and it was approved (it's linked above).

Edit: The map files are working correctly.

@JosepAlacid
Copy link

This warning still apears.

1 similar comment
@Veyhunk
Copy link

Veyhunk commented Apr 6, 2018

This warning still apears.

@ajmalhassan
Copy link

This warning still appears.

@nickthakkar
Copy link

@JosepAlacid @Veyhunk @ajmalhassan try using the fix that @hanifmazlan suggested. It actually works for me. https://stackoverflow.com/a/48315414/3288671

@bobbino
Copy link

bobbino commented Apr 18, 2018

True, it does, but as @StefanRein suggests, it's still miles away from any production-like environment. better to avoid node_modules. Still waiting for a proper fix. Any updates from the Ionic Team?

@kirillgroshkov
Copy link

This warning still apears.

4 similar comments
@ElissandroMendes
Copy link

This warning still apears.

@thorizer
Copy link

This warning still apears.

@theer1k
Copy link

theer1k commented May 20, 2018

This warning still apears.

@Ruslancic
Copy link

This warning still apears.

@StefanRein
Copy link

StefanRein commented May 31, 2018

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.

@jhonnhenry
Copy link

This warning still apears.

@emcniece
Copy link

emcniece commented Jun 8, 2018

@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.

@islameg26
Copy link

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

imhoffd pushed a commit to ionic-team/ionic-app-scripts that referenced this issue Aug 24, 2018
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 to `undefined` to prevent this warning

`from: the input file name (most runners set it automatically).`
Source: https://github.com/postcss/postcss

Fixes #1359 #13763
#1359
ionic-team/ionic-framework#13763
@trsh
Copy link

trsh commented Nov 30, 2018

Still got his warning. Jumping into node_modules is no serious ::/

@paulstelzer paulstelzer added the ionitron: v3 moves the issue to the ionic-v3 repository label Dec 8, 2018
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 8, 2018

Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

Thank you for using Ionic!

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 8, 2018

Issue moved to: ionic-team/ionic-v3#883

@ionitron-bot ionitron-bot bot closed this as completed Dec 8, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: v3 moves the issue to the ionic-v3 repository
Projects
None yet
Development

No branches or pull requests