-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
style-loader breaks source maps in Firefox 59 #303
Comments
style-loader
breaks source maps in Firefox 59
@robertjk Thanks! |
@robertjk Confirm, let's investigate, maybe bug in firefox |
@evilebottnawi What do you mean by "Confirm"? Yes, it may be a bug in Firefox, as in Chrome everything works fine. |
@robertjk Confirm is mean it are not you local or configuration problems 😄 |
@evilebottnawi Oh, I get it :). |
Maybe we should search better way for https://github.com/webpack-contrib/style-loader/blob/master/lib/addStyles.js#L366 |
In firefox@59 all works fine. Seems bug in firefox. Only |
I'm not sure what you mean by "In firefox@59 all works fine" -- I'm seeing |
I think "Only With the example repo provided by the issue opener, I ran: > yarn webpack --config ./webpack.style-loader.babel.js
> serve dist Firefox 58 and Firefox 60 (Developer Edition) both print "Source map error". |
The same is happening to me. It's breaking my Vue app on Firefox only (works fine on Chrome, Edge and Safari). I'm also using CSS variables as mentioned here. Firefox version: 59.0.2 |
I think it is firefox bug, somebody can take care this issue and create report to firefox bugs tracker? |
I think this is the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1451274, The issue is:
So, one must at least write It seems to be a long way for a fix to eventually land in Firefox. 😢 |
I'm having the same problem with webpack 4 (4.12.1 - lastest version) and firefox dev edition (62.0b3 - lastest version too). |
have same issue |
Anyone find a temporary workaround? Any chance a plugin could reformat the URL to work? |
This is still happening to me in Firefox 61.02. Is this a confirmed Firefox bug? It's been happening since 59 for me. No issues in Safari. |
@wokejacqueline This issue over in the main Webpack repo has some more info than this issue has: webpack/webpack#1194 I haven't found any devTool option that works, even though others have. There are three or four projects that could offer a fix, but it seems like the project maintainers keep saying "the issue is over there"...for the last three years or so. |
A solution is ditching
If your config was this:
It will now be this:
Hot reloading works, source maps work |
I think so, Thank you! The warning message on Firefox are gone but source map still not work. |
@mikehdt yep, source maps still not work in firefox 😞 try to search bug in their bug tracker |
Firefox bug:
Sorry we can't do something on our side here, please write to firefox bug tracker |
works fine for me in Firefox after 1.0 release |
@Austaras it is strange, can you provide example? Also provide Firefox version |
@evilebottnawi this repo |
@Austaras thanks, maybe firefox fix bug in latest release, i have problems on |
@Austaras I clone and run you example on Firefox nightly but it still not work |
@minhtranite |
Hi! If the info can help: I'm using Firefox 69.0b11 (64-bit) on Windows 10. Upgrading from style-loader 0.23.1 to 1.0.0 removed the message |
I looked into this on the Firefox side, and I'm not sure I'd consider this a Firefox bug, but rather a case where Chrome may have more fallbacks to handle invalid sourcemaps. We can certainly look into potentially handling this, but the map as it stands does not contain valid In the case of the example provided in the initial post, the
and the map
with the critical difference being that the first is an absolute URL, and the second is only a path-absolute URL, meaning that the second one requires a valid base URL in order to be resolved into a full URL (and the blob: URL used in this case is not a valid base). When this map is loaded, it is resolved based on the URL of the CSS file, so you end up with
which then throws because you can't have a filepath relative to a blob URL. It seems like Chrome may have some fallback here that just uses the overall page's URL if no other valid base is found. For |
@loganfsmyth Thanks for doing all this research. I had a feeling it was a Webpack bug, because source maps have worked in Gulp and every other build tool I've used ans JS sourcemaps are broken, too. Anybody know how we can get this escalated to someone who can merge PRs? The last PR for webpack-contrib that I got involved in has been sitting open since 2017. 🙄 |
For me in turned out to be the React Developer tools add on, the moment I disabled it, the source maps changed from inline to the proper sass partial. It works with this set up:
Firefox Developer Edition 71.0b5 / macOS Mojave |
Disable react dev tools, it worked for me |
@alvaro-escalante does that mean it's a React Dev Tools issue? I searched but I didn't find any issue reported on their repo. |
It's not a React Dev Tools problem. This issue has more info and discussion: webpack/webpack#1194 |
React Dev Tools did in fact affect the sourcemaps on Firefox with But in the end I started using the
|
I am not using a Any idea what that could have been interpreted as? It's confusing me because this doesn't really match what others have discovered, unless it is triggering some unexpected behavior. There are definitely race conditions that cause it to work occasionally, and maybe an errand flag can clue us in. |
Adds configuration to bubble up CSS sourcemaps via various Webpack loader configurations. Swaps the style-loader for getting CSS into pages with the mini-css- extract-plugin and uses an alternate devtool strategy for development and production source maps. This appears to be a combination that works across browsers and in both development and the build. See webpack-contrib/style-loader#303 (comment) and https://webpack.js.org/plugins/mini-css-extract-plugin/
Still broken 😞 |
Sorry for delay, looks reasonable #303 (comment), I will look at this deeply |
@evilebottnawi Are you sure it's still broken? I think https://bugzilla.mozilla.org/show_bug.cgi?id=1607639 has fixed this. When I run the reproduction example, I see SCSS files in the style editor in FF. |
Strange, I reproduce this problem on FF? Can you provide version of FF? |
@evilebottnawi I found I had less problems with Firefox if I set this in my webpack plugin settings:
|
Fixed in Firefox 79, It's been a long time, anyway I want to test it on other browsers, maybe we really can improve it |
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
When I have
style-loader
in my CSS loaders chain, the source maps do not work in Firefox. I see error messages in the Developer Tools console like the one below. SettingconvertToAbsoluteUrls: true
doesn't change the situation.Source map error: Error: sourceMapURL could not be parsed Resource URL: blob:http://localhost:8080/3a52944e-4117-4d8d-98d6-32cd525beae9 Source Map URL: data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3JvYmVydC9wcm9ncmFtbWluZy93ZWJwYWNrLXBsYXlncm91bmQvc3JjL2NvbXBvbmVudC1hL3NyYy9jb21wb25lbnQtYS9jb21wb25lbnQtYS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBO0VBRUksY0FBYTtFQUNiLHVCQUFzQjtFQUN0QixrQkFBaUIsRUFZcEI7RUFWRztJQUNJLG1CQVhJO0lBWUosaUJBQWdCO0lBQ2hCLGlCQUFnQixFQUNuQjtFQUVEO0lBQ0ksbUJBaEJNLEVBaUJUIiwiZmlsZSI6ImNvbXBvbmVudC1hLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIkbWFyZ2luOiA1cHg7XG4kcGFkZGluZzogMTBweDtcblxuXG4uQ29tcG9uZW50QSB7XG5cbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gICAgZmxleC13cmFwOiBub3dyYXA7XG5cbiAgICAmLUhlYWRlciB7XG4gICAgICAgIG1hcmdpbi1ib3R0b206ICRtYXJnaW47XG4gICAgICAgIGJhY2tncm91bmQ6ICNlZWU7XG4gICAgICAgIGZvbnQtc2l6ZTogMS41ZW07XG4gICAgfVxuXG4gICAgJi1Cb2R5IHtcbiAgICAgICAgcGFkZGluZy1sZWZ0OiAkcGFkZGluZztcbiAgICB9XG5cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=[Learn More]
When I remove
style-loader
and useextract-text-webpack-plugin
instead, the source maps start to work. In addition even ifstyle-loader
is used, everything works fine in Chrome Developer Tools.I created an example repo with the problem: https://github.com/robertjk/webpack-firefox-source-map-error.
What is the expected behavior?
I expect source maps to work properly in Firefox, as they do when
style-loader
is not used.Additional info
Firefox version: 59.0b8
Node.js verison: 9.5.0
webpack
version: 3.11.0style-loader
version: 0.20.1The text was updated successfully, but these errors were encountered: