-
-
Notifications
You must be signed in to change notification settings - Fork 87
Source map URLs shouldn't be prefixed with a local path #77
Description
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Some libraries (i.e. nearly all created via Scala.JS) have URLs in their source maps. However when being used with webpack, webpack is prepending a ./ to all the URLs results in trillions of warnings like this:
[info] Cannot find source file 'https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/Vector.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/Vector.scala' in '/home/golly/projects/misc/target/scala-2.12/scalajs-bundler/main'
[info] @ ./fastopt-launcher.js 1:0-91
[info]
[info] WARNING in ./demo-fastopt.js
[info] Cannot find source file 'https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/List.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/List.scala' in '/home/golly/projects/misc/target/scala-2.12/scalajs-bundler/main'
[info] @ ./fastopt-launcher.js 1:0-91
[info]
[info] WARNING in ./demo-fastopt.js
[info] Cannot find source file 'https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/Stream.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/Stream.scala' in '/home/golly/projects/misc/target/scala-2.12/scalajs-bundler/main'
[info] @ ./fastopt-launcher.js 1:0-91
[info]
[info] WARNING in ./demo-fastopt.js
[info] Cannot find source file 'https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/StringOps.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/StringOps.scala' in '/home/golly/projects/misc/target/scala-2.12/scalajs-bundler/main'
[info] @ ./fastopt-launcher.js 1:0-91
[info]
[info] WARNING in ./demo-fastopt.js
[info] Cannot find source file 'https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/WrappedString.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala/scala/v2.12.1/src/library/scala/collection/immutable/WrappedString.scala' in '/home/golly/projects/misc/target/scala-2.12/scalajs-bundler/main'
[info] @ ./fastopt-launcher.js 1:0-91
And resulting in a final source map that no longer works for those libraries.
If the current behavior is a bug, please provide the steps to reproduce.
Setup any dummy project with Scala.JS and scalajs-bundler which runs everything through webpack.
What is the expected behavior?
Source map links that can be identified as absolute URLs should be used as is, without modification.
I believe the fix would be a very simple test like this before prepending:
https://github.com/jantimon/html-webpack-plugin/pull/619/files
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Using webpack 2.2.1, Node.JS 7.7.3.
This issue was moved from webpack/webpack#4518 by @evilebottnawi. Original issue was by @japgolly.