This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
When I turn source maps on and re-save an existing coffee file from my project it appends this to the end of the js file: //@ sourceMappingURL=myFile.coffee Shouldn't this be pointing to the map file, not the coffee file? And the map file looks like this: { "version": 3, "file": "", "sourceRoot": "", "sources": [ "" ], "names": [], "mappings": "...stuff..." } Notice that file ect fields are blank. I doubt this is correct output as it doesn't work at all. Am I doing something wrong? Is my build broken? I am using version 3.2.804.22538 |
|
|
Thanks for reporting this - this will be fixed in the next update which will be pushed up to the gallery later today.
|
|
|
Thanks Jeremy. I seen an update posted this afternoon and installed it. Things are a little bit better but still look wrong. If this is not the update you were talking about then I apologize. The js file looks to be getting the correct comment: //@ sourceMappingURL=myCoffee.js.map However the map file is still missing the file/sourceRoot/source elements: { "version": 3, "file": "", "sourceRoot": "", "sources": [ "" ], "names": [], "mappings": "..." } |
|
|
Thanks for the update - are you able to send through your Coffee file as we are just emitting what the Coffee compiler is returning back so I will need to trace what it is doing to determine if its an issue with CoffeeScript or something else.
|
|
|
Sure but I would like a private email address rather then posting to the public forum. Edit - I've re-saved a number of coffee files, and I'm seeing the same result in each, correct comment in *.js but missing fields in *.js.map. This solution has had mindscape installed for a long time, maybe I've got some old stuff in a config file somewhere? Edit 2 - No, I started a new project added and saved a simple coffee script and I'm seeing the same thing as above. Coffeescript1.coffee: $ -> alert 'hi' Coffeescript1.js (function() { $(function() { return alert('hi'); }); }).call(this); //@ sourceMappingURL=CoffeeScript1.js.map Coffeescript1.js.map { "version": 3, "file": "", "sourceRoot": "", "sources": [ "" ], "names": [], "mappings": "AAAA;CAAA,CAAA,CAAE,MAAA;CACQ,GAAN,CAAA,MAAA;CADJ,EAAE;CAAF" } Coffeescript1.min.js (function(){$(function(){return alert("hi")})}).call(this); For that matter a completely empty coffee file gives the same results. |
|
|
Gotcha, Coffee returns these to us empty and I guess we need to populate them. Like with the sourceMappingURL the most sensible values I believe would should put here is for the sourceRoot to be the relative path between the generated .js and the originating .coffee and for the sources to be the originating Coffee file. In practice this would then rely on you having the same structure maintained when this is loaded into a debugger. Unless you see something I have overlooked here I will update things with this approach.
|
|
|
Quick update here, this has now been updated in the current nightlies and most recent gallery update.
|
|
|
Thanks Jeremy, I'm taking a look now but first thing - create a new coffeescript file, and hit save. I'm seeing:
Edit - Ok this also seems to be a big problem: No source map file is created! I created a new blank coffeescript file, added the code "alert 'hello'" and save it. I get the error above, but no map file. The javascript file references the non-existing file though:
I imagine whatever is causing that error is stopping the map file from being written. |
|
|
Looks like I'm having the same problem as Adan in the latest version as well. |
|
|
Thats no good to hear. Im not able to reproduce this here but based on the error you are getting I have added a guard against this and this is now updated in the nightly builds. I would expect however that you will probably not get the correct output since the error would appear to be coming from one of the replacements we are making in the mapping output to inject the details of the source file (which apparently in this case is non existant...) I would like to try and reproduce this more directly though rather than just guard against the error since it would appear something must be a bit different in the cases which you are running under and I would like to make sure we properly support this if possible. Is it possible to either get a copy of a project where you are seeing this occur? You can email this through to us at support at mindscape.co.nz rather than attaching it to the forum post if you would prefer.
|
|
|
I created a new Asp.Net MVC 4 application, added a "Scripts" folder, and added "scripts.coffee" file, and saved the empty file. This produced the same error, and did not generate the map file.
|
|
|
Sorry, it appears there was an issue with the nightlies and the most recently uploaded build does not actually contain the fix, Ive sorted out the issue at this end so it should be pushed up tonight barring another traffic jam on the build server :)
|
|
|
I don't have access to nightly builds anymore sadly, do you know when this might hit the gallery? |
|
|
We are likely to push up a new gallery release either next week or early on the following week so it will be included with that update.
|
|
|
I was able to grab the update and a new empty script file is now generating a map file that looks correct, so hurray! Awesome! I don't the time right now to generate map files for production scripts to see if they are working properly but I'm very happy to see this feature working properly. Thank you so much! |
|