Source Maps not working
Reported by
famecas...@gmail.com,
Jan 1
|
||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36
Steps to reproduce the problem:
1. Have a project folder containing those files: "static/coffee/lazyload.coffee" (containing a simple "Hello World" console.log), "static/coffee/lazyload.js", "static/coffee/lazyload.js.map"
2. Use a web server like pythons Flask in the project directory to serve these static files.
3. Reference the compiled coffeescript file "lazyload.js" in HTML
4. Open the Chromium DevTools to see the "Hello World" output
What is the expected behavior?
In the JavaScript Console, there will be the "Hello World" message and a link to the source at the right side ("lazyload.coffee:1"), which links to the mapped source file.
What went wrong?
Actually, the source is ("lazyload.js:2"), which is the transpiled file. The source map is not working, although, when I reveal the lazyload.js source in the DevTools, there is a small banner saying "(i) Source Map detected. Associated files should be added to the file tree. You can debug these resolved source files as regular JavaScript files. Associated files are available via file tree or Ctrl+P".
Did this work before? N/A
Chrome version: 67.0.3396.99 Channel: n/a
OS Version:
Flash Version:
I already read through some threads like this: https://github.com/nodejs/node/issues/8369. There are also (closed) chromium bugs referenced in this github conversation. I would like to point out, that I am not using any framework like Node or Electron. All I use, is a simple Python Flask server.
Since the same application is completely working as expected on Firefox, this seems to be clearly a bug related to Chromium. This is the transpiled file:
(function() {
console.log("Hello World!");
}).call(this);
//# sourceMappingURL=lazyload.js.map
I am using Ubuntu 17.10 with the latest updates.
,
Jan 2
famecastle@gmail.com Thanks for the bug report. Could you provide the version of the coffeescript compiler you are using and the lazyload.coffee, lazyload.js.map, and lazyload.js files if you can to help us reproduce the problem?
,
Jan 3
I can't reproduce this with CoffeeScript 2.3.2. Can you open your settings in Devtools (f1) and verify that "Enable JavaScript Sourcemaps" is checked?
,
Jan 5
Thank you for the responses. I am using a Visual Studio Code extension called "Easy CoffeeScript" which compiles the the coffee files, when they are saved. This extension comes bundled with a CoffeeScript transpiler. The extension version is "1.2.0" and the CoffeeScript version "^2.3.0". I renamed "lazyload.*" to "test.*" for testing purposes (I attached the source files as requested). In the index.html <head>, I reference the js file like this: <script src="test.js"></script> |
||
►
Sign in to add a comment |
||
Comment 1 by swarnasree.mukkala@chromium.org
, Jan 2