nw.js
nw.js copied to clipboard
Our sourcemaps no longer loading in v0.52.0 and later
NWJS Version : nwjs-sdk-v0.52.0-win-ia32 Operating System : Windows 10 Pro
Expected behavior
Sourcemaps should load like they do in v0.51.2
Actual behavior
After updating to v0.52.0 we get ERR_BLOCKED_BY_CLIENT in console for our sourcemaps. Tested this in v0.53.0 as well. Sourcemaps do load correctly in v0.51.2
How to reproduce
Reproducing it exactly on your end may be difficult, but here's a screen grab of console. Using the SDK from v0.51.2 works fine and sourcemaps are loading. But updating to SDK v0.52.0 and later breaks it...
seeing this on 0.52.2
Same with 0.53.1 and 0.54.0. All requests for .map
are denied with net::ERR_BLOCKED_BY_CLIENT
.
Using macOS Big Sur (Macbook Air M1, with the x64 build of nwjs via Rosetta).
I think this happens with all sourcemaps regardless of origin. But if it helps reproducing, here is the app that I've been using with 0.54.0.
Strangely, if I try to fetch()
the very same URL that devtools is complaining about, I do not get an ERR_BLOCKED_BY_CLIENT.
suslik.tar.gz
Same problem, downgraded to 0.51.2 and it works fine
Upstream crbug: https://crbug.com/974543 and https://crbug.com/1052872
Not a nw issue actually, just wait for Chromium update.
I can confirm that now (0.55.0) it really only happens on chrome-extension://
, so a viable hack for debugging is to set the URLs of the .map
files to absolute file://
URLs.
I am using the following setting in my webpack.config.js
:
devtool: false,
plugins: [
new webpack.SourceMapDevToolPlugin({
append: `\n//# sourceMappingURL=file://${__dirname}/dist/[url]`,
filename: '[name].map'
})
]
Same in 0.55.0 and now in 0.56.0 :-(
same in 0.56.1
Added this to my documentation of NW.js versions.
- https://dev.to/thejaredwilcurt/guide-to-nw-js-versions-5d38
When this is fixed upstream and NW.js receives the update, let me know and I'll update that post again.
Until then, no more "+1s" are needed on this issue, as it is a documented chromium bug, and not NW.js.
It looks like the nightly build (0.58.0) includes the fix. At least, my sourcemaps are showing now ð
@corwin-of-amber not seeing the fix in 0.60.0
Same, can confirm my source maps don't load either in latest nwjs build.
On Tue, Jan 25, 2022, 6:13 AM Zayin Krige @.***> wrote:
@corwin-of-amber https://github.com/corwin-of-amber not seeing the fix in 0.60.0
â Reply to this email directly, view it on GitHub https://github.com/nwjs/nw.js/issues/7724#issuecomment-1021079498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3BX2F6HQSTYSVB7L2S5CTUX2AW3ANCNFSM44KPSOGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
I solved this problem. Moved to Tauri. Easy setup, everything works, no dependency worries, small footprint. As a side benefit, you get to learn Rust which frees you from other legacy luggage. Happy coding!
@zkrige @bswanwick Curious â my source maps still work in both 0.59 and 0.60, although I now notice that the mapped filenames do not appear in the source listing to the left. Ctrl+P (or Cmd+P) then typing the filename does find them. Is your case similar?
@zinuru ð
@zkrige @bswanwick Ok strike that, it turns out I was using inline maps in that particular project ð When I switch to linked map files I definitely get ERR_BLOCKED_BY_CLIENT, so yes, definitely still an issue. ðĶĒ
this appears fixed in 0.62.1 ð
Yes it seems to be fixed. However on 63.0 at least we seem to get broken Code highlighting (At least for TypeScript).
This is just a function in a class and it seems to only sometimes correctly render colors for some line. The code is otherwise valid and the JS variant also renders fine.
Fixed in upstream
It did not work for me out of the box.
For people who still have issues, this solved it for me:
- Right click inside the text of the uglified file, click
Add source map...
- When it prompts you for the source map path, specify the full absolute
file:///
path (example/home/my_user/myProject/build/app.source.map
)