Skip to content
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

Local sourcemaps can not be parsed in 0.44.1 #7373

Closed
arudnev opened this issue Feb 12, 2020 · 4 comments
Closed

Local sourcemaps can not be parsed in 0.44.1 #7373

arudnev opened this issue Feb 12, 2020 · 4 comments

Comments

@arudnev
Copy link

arudnev commented Feb 12, 2020

Not sure if this is the same as #4730, but maybe we are simply missing some configuration option here to allow local source maps.
It seems that source maps that are included as part of packaged app have not been working for a while, even though they are working for javascript that is loaded remotely.
Staring with 0.44.x new warning is printed in console that potentially provides some insights on the issue.
In 0.42.x - 0.43.x it does not print the warning, but it does not look like maps are working either, not sure.

NWJS Version : 0.44.1
Operating System : macOS Catalina (10.15.3)

Expected behavior

Source maps included packaged into the app should be properly reflected in source tree.

Actual behavior

Warning is printed the console and sources referenced in the source maps are not available in the source tree / search.

How to reproduce

rm -rf "${HOME}/Library/Application Support/nwjs-sourcemaps-test" && \
cd /tmp && rm -rf nwjs-sourcemaps-test && mkdir -p nwjs-sourcemaps-test/js && cd nwjs-sourcemaps-test && \
for f in "index.html" "js/main.js" "js/main.js.map"; do curl -s "https://mdn.github.io/devtools-examples/sourcemaps-in-console/${f}" -o ${f}; done && \
echo '{"name": "nwjs-sourcemaps-test", "main": "index.html"}' > package.json && \
~/Downloads/nwjs-sdk-v0.44.1-osx-x64/nwjs.app/Contents/MacOS/nwjs .

nwjs-sourcemaps-test-local.zip

Screenshot 2020-02-12 12 49 17

Screenshot 2020-02-12 12 49 00

At the same time, source map is processed correctly when loaded from remote url

rm -rf "${HOME}/Library/Application Support/nwjs-sourcemaps-test" && \
cd /tmp && rm -rf nwjs-sourcemaps-test && mkdir nwjs-sourcemaps-test && cd nwjs-sourcemaps-test && \
echo '{"name": "nwjs-sourcemaps-test", "main": "https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html"}' > package.json && \
~/Downloads/nwjs-sdk-v0.44.1-osx-x64/nwjs.app/Contents/MacOS/nwjs .

nwjs-sourcemaps-test-remote.zip

Screenshot 2020-02-12 12 51 10

@gpetrov
Copy link

gpetrov commented Feb 14, 2020

We have the same problem - devtools is full with all the sourcemaps failed errors and makes debugging really painful - hope @rogerwang can solve it soon

@rogerwang
Copy link
Member

Thanks for the sample but it doesn't include the source code in coffeescript?

@arudnev
Copy link
Author

arudnev commented Feb 16, 2020

Ah, somehow I assumed that this source map included sources as that's how we typically generate our source maps with webpack, my bad.

Anyway, downloading js/main.coffee does not change the outcome - we would still get warning about parsing of .../js/main.js.map and it still would not show .../js/main.coffee in the source tree. Here is updated example.

rm -rf "${HOME}/Library/Application Support/nwjs-sourcemaps-test" && \
cd /tmp && rm -rf nwjs-sourcemaps-test && mkdir -p nwjs-sourcemaps-test/js && cd nwjs-sourcemaps-test && \
for f in "index.html" "js/main.js" "js/main.coffee" "js/main.js.map"; do curl -s "https://mdn.github.io/devtools-examples/sourcemaps-in-console/${f}" -o ${f}; done && \
echo '{"name": "nwjs-sourcemaps-test", "main": "index.html"}' > package.json && \
~/Downloads/nwjs-sdk-v0.44.1-osx-x64/nwjs.app/Contents/MacOS/nwjs .

nwjs-sourcemaps-test-local.zip

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants