Sourcemap not working


I can’t open source files from my browsers anymore. I don’t know why. It stops working something like 2 weeks ago. It seems that all my browsers are affected (all Chromium based, I even tried on a second PC).

When I open the devtools, I can see all the sources files on the page panel on the left but when I try to open one file by clicking on it or by pressing CTRL + P, this is what I got:

Could not load content for http://localhost:2000/C:/HaxeToolkit/haxe/lib/lime/7,8,0/src/haxe/io/Bytes.hx (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)

I’ve checked the .map file and I can see "sourceRoot":"file:///", so the URL of the files should be file:///C:/HaxeToolkit/haxe/lib/lime/7,8,0/src/haxe/io/Bytes.hx and not with localhost prefix. Am I correct?

I think it’s related to a browser update and not openfl, but any help appreciated, thanks.

What can I do to fix that? I’m becoming crazy without sourcemaps :confused:

I’ve just downloaded and tried Firefox and…it doesn’t work! This is the error I got:

Error while fetching an original source: unsupported protocol for sourcemap request 
Source URL: <unknown>

Looks OK for me.
Chrome, Version 100.0.4896.127 (Official Build) (64-bit)

Thanks for your screenshot. I have Chrome version 101.0.4951.54

Could my firewall or antivirus blocks it?

But I need to say that I have a full js project compiled with webpack working with source map…so I don’t know why openfl sourcemap doesn’t work.

In @gonzos devtools, we can see that source files are in the file:// directory. But in mine, they are under the localhost:2000 directory (despite the "sourceRoot":"file:///" rule in the .map file)

I have also tested Chromium 79, and it works! So for now I can use that to debug my projects but I need to find a solution to debug on up to date browers (browsers not working : chrome, opera, edge, firefox).

So I’ve just downloaded Chromium Version 100.0.4896.0 (Build de développement) (64 bits) which is supposed to be older that your version @gonzos and it doesn’t work (I have not found your specific version). What the heck is wrong?

I have downloaded and tested Chromium Version 96.0.4664.0 (Build de développement) (64 bits) and it works. So I can stick around with this version for a little while waiting for a fix.

Also I’ve found a workaround by adding in the .map file file:/// in each path in the sources variable. E.g: "sources":["file:///C:/HaxeToolkit/haxe/lib/lime/7,8,0/src/lime/app/Module.hx",...
So this could be needed in openfl if the Chromium team doesn’t provide any fix.

I think that source maps are generated by the Haxe compiler, so if any fix is needed, it will probably be there.

Which version of Haxe are you using? Maybe the source maps are generated somewhat differently by different versions of Haxe.

For instance, I am using Haxe 4.2.5, and I just did a fresh compile for html5 -debug. I see an empty "sourceRoot":"" in my .map file. Additionally, all paths listed in "sources" start with file:///. I didn’t need to add that manually, like you mentioned you had to do. It was already like that.

I’m (cough) having the same problem. Haxe 4.1.5.
Thanks @loudo for the workarounds.

For the record, here you can download the Chromium 79 builds:
You must drill down into your platform’s directory then paste “706915” into the filter field.

Thanks for the link. That what I did for version 96 (which is faster than 79)

Good news! Thank you!

For the record again, for Chromium version 96 I pasted “929513” as the filter (Branch Base Position). For users in the world who need to enable the “Override software rendering list” flag in Mac OS 10.13 (probably just me), it doesn’t behave properly in Chromium 96, but 79 does work.

Firefox Developer edition 93 has working source maps also.