Closed lookfirst closed 8 years ago
Ah, forgot about source maps. Try passing in sourceMaps: true
in the buildFlags and see if that gives you what you expect. If not I'll have do do some extra work to make source maps work.
This is all really good feedback :D
This branch should add sorucemaps. I haven't had time to create a setup to verify that all paths are correct. It's bedtime on my end, so I'll pick this up and verify some time tomorrow. If you would like to try this branch immediately to help me verify npm install Munter/express-systemjs-tranlate#sourcemaps
that command fails... can't find the branch.
i see the typo
The 'tree' for the sourcemaps are made, but the 'file' shows up blank in chrome.
Sounds like the paths might not be entirely correct. First step though
How can I help? =)
Just noticed this in my web server log, which appears to be the result of trying to load the source file... /js/sell/js/sell/sell/ordersModule.js
It should be: /js/sell/ordersModule.js
So I have source maps working locally now and just need to make it a bit pretty. But one problem still remains. The source of the requested file will never show the original content. It always shows the served bundle. Doesn't matter if I send sourcesContent
in the source map or not. This seems to be because of the conflicting file name. Sending a Vary: Accept
header does not make the browser reconsider what to show in the sources tab.
The only way I can think of fixing this right now is to redirect to a different file name when responding to a request with Accept: application/x-es-module
, just to get the name of the original resource unblocked. That feels a bit ugly to me though.
Any other ideas? @gustavnikolaj @papandreou @guybedford
I have created this page to show an example of the problem I'm encountering: http://source-map-sources.surge.sh/
Redirecting to a different url that serves the bundle doesn't work. the sources tab will show the source as if it came from the originally requested url.
@papandreou suggested modifying the url of the bundle target in the source mapsources
array, appending a ?original
query or similar. I tried implementing it and that seems to at least get the source visible under this new fake name in the dev tools sources tab. But I couldn't get breakpoints to work as the file apparently then becomes unrelated
@Munter thanks for your hard work on this. i'm excited to use it when it is working. =)
Just had a look at this and the inlined sourceMappingURL seems to be missing the leading #
character after the comment?
screenshot: http://take.ms/bBBPc
I merged my source map branch. All sources which are not in the original file requested should now be shown correctly. I'm still having trouble with getting browsers to display the original source for the requested file, as all browers I have tested in will show resuested.js (translate bundle) instead of requested.js (source map sources). You can test the current state by installing from the master branch. I haven't cut a release yet as I'm not confident with the missing tests right now
And finally I found the thing I missed. https://www.npmjs.com/package/inline-source-map-comment strips source map sourcesContent
by default. DOH!
Released in 3.1.0
I wish you could close this, but it still isn't working for me. =( Now it just isn't running my code at all. I can also see multiple 'app.js' files in the inspector tree even though there should only be one in /sell/app.js
. The one in /sell/app.js
is blank and the other one has the System.register wrapped output..
screenshot: http://take.ms/iVqel
I think you need to set the serverRoot
config option. Looks like the paths for app.js are different. They shouldn't be
I have serverRoot set.
Please enable the debug
option and copy sourcesRoot
and sources
from the debug sourcemap that is injected at the bottom of the bundles response. That might help me figure out if there is a bug in the path resolving between serverRoot
and systemjs baseURL
v4.0.0 is out. serverRoot is now required and normalization is false by default: https://github.com/Munter/express-systemjs-translate/releases/tag/v4.0.0
Ok, things are working now, but if I throw a 'debugger' line into my javascript, it doesn't stop in the map file generated source, but instead just shows the actual source code.