nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Our sourcemaps no longer loading in v0.52.0 and later

Open bswanwick opened this issue 3 years ago â€Ē 17 comments

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...

sourcemaps_missing

bswanwick avatar May 07 '21 16:05 bswanwick

seeing this on 0.52.2

zkrige avatar May 11 '21 13:05 zkrige

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).

corwin-of-amber avatar May 28 '21 18:05 corwin-of-amber

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

corwin-of-amber avatar May 28 '21 18:05 corwin-of-amber

Same problem, downgraded to 0.51.2 and it works fine

trethaller avatar Jul 02 '21 15:07 trethaller

Upstream crbug: https://crbug.com/974543 and https://crbug.com/1052872

Not a nw issue actually, just wait for Chromium update.

Cubelrti avatar Jul 07 '21 03:07 Cubelrti

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'
    })
  ]

corwin-of-amber avatar Aug 31 '21 12:08 corwin-of-amber

Same in 0.55.0 and now in 0.56.0 :-(

zinuru avatar Sep 08 '21 02:09 zinuru

same in 0.56.1

zkrige avatar Sep 22 '21 07:09 zkrige

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.

TheJaredWilcurt avatar Oct 27 '21 00:10 TheJaredWilcurt

It looks like the nightly build (0.58.0) includes the fix. At least, my sourcemaps are showing now 😄

corwin-of-amber avatar Nov 29 '21 19:11 corwin-of-amber

@corwin-of-amber not seeing the fix in 0.60.0

zkrige avatar Jan 25 '22 11:01 zkrige

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: @.***>

bswanwick avatar Jan 25 '22 12:01 bswanwick

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!

zinuru avatar Jan 26 '22 22:01 zinuru

@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? Screen Shot 2022-01-27 at 19 31 18

@zinuru 😅

corwin-of-amber avatar Jan 27 '22 17:01 corwin-of-amber

@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. ðŸĶĒ

corwin-of-amber avatar Jan 27 '22 17:01 corwin-of-amber

this appears fixed in 0.62.1 👏

zkrige avatar Mar 25 '22 12:03 zkrige

Yes it seems to be fixed. However on 63.0 at least we seem to get broken Code highlighting (At least for TypeScript).

grafik

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.

Regiden avatar Apr 14 '22 06:04 Regiden

Fixed in upstream

ayushmanchhabra avatar Oct 15 '22 16:10 ayushmanchhabra

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)

aggregate1166877 avatar Nov 09 '23 08:11 aggregate1166877