-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Sourcemaps pointing to wrong file #1078
Comments
Just to note, as seen in someother issues setting sass-load outputStyle to compressed seems to make things worse.
See how the sourcemaps now point to the files containing the mixin in the actual style definition.
|
In all of the above examples There is only one style block/definition for Im starting to believe this issue stems from element styles being defined in multiples. This doesn't answer the question on why compressed shows the mixin definition file however. |
Problem in firefox (known issue) To be honestly we don't modify source maps from node-sass, so problem in postcss-loader or in your minificator |
If you look at the repository i posted there is no post css or minification that takes place when producing these errors. Sass-loader is passed to css-loader then onto mini css extract plugin. |
Looks problem in css-loader/ MCEP, i will looks on this in near future, reproducible test repo is enouth, thanks |
Great! I don’t know where to start with debugging this but if theres anything i can do to help just let me know! |
switching on |
Yep, bug on
in |
I was wrong, bug in |
@evilebottnawi given the bug has now been narrowed down to css-loader, i assume we can rule out dart sass being a fix (ie node-sass being the issue)? |
@JParkinson1991 not sure, using |
Yeah it does seem like a tricky bug to track down! Atleast there is some sort of work around in place with using dart sass. Just for clarity, using dart sass with I will dig around this soon and verify dart sass can be used as a work around. |
Yes
I already checked this and everything works fine, I'm not sure that I can find the time to track down this error in the near future |
Just updated the reproducible repository to include dart sass test cases. Everything working as expected. |
Let's close in favor #622, I will add tests to ensure what we fix it after source map improvements |
It seems that there (somewhere in the chain) are some alterations to node-sass generated sourcemaps which results in them pointing to the wrong scss source declarations.
The sourcemaps do not point to completely the wrong file, the point to a file/line in which styling exists for the element, just not the file/line where the shown styles have been defined.
Assumptions
Screenshots
Webpack generated sourcemap - broken - chrome browser
node-sass generated sourcemap - working - chrome browser
How Do We Reproduce?
Reproducable repository here:
https://github.com/JParkinson1991/webpack-sourcemaps-debug
The
./public/index.html
page in the above repository will show the expected locations of sourcemap references.These expected locations are correct when the sourcemaps are generated/styles compiled with node-sass directly. This can be achieved by running the following in the above repository
npm run script build:node-sass
However, when compiled using webpack and usings its generated sourcemaps the locations do not match up, they are not compeltely wrong in that they reference somewhere in source where this file has been generated, but not the correct point in the code.
Can be checked by running the following in the above repository
npm run script build:webpack
Testing
In chrome, when source compiled with node-sass the sourcemaps are correct, they are incorrect when compiled with webpack.
In firefox, sourcemaps are incorrect when source compiled with both webpack and node-sass
If you need anymore information on this one, let me know.
Thanks in advance for any help/input provided on this one!
The text was updated successfully, but these errors were encountered: