Skip to content

Source map URLs shouldn't be prefixed with a local path #77

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

Closed
webpack-bot opened this issue Dec 25, 2018 · 1 comment · Fixed by #100
Closed

Source map URLs shouldn't be prefixed with a local path #77

webpack-bot opened this issue Dec 25, 2018 · 1 comment · Fixed by #100

Comments

@webpack-bot
Copy link

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.

@alexander-akait
Copy link
Member

/cc @japgolly feel free to send a PR with updating loader-utils and adding isUrlRequest before run this.resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment