hyude Posted September 12, 2014 Share Posted September 12, 2014 Hello, I am currently learning how to use phaserJS, I am familiar with game development process, and I create HTML5 games before. Upon trying tutorial from Phaser and HelloPhaser, I tried it out on my localhost (with Apache server ON). It works, but on google chrome, the console shows an error "404 File Not Found" while trying to access phaser.map file. Granted, there is no phaser.map file, and only a single minifed phaser file. What confuses me is, why should it ask for phaser.map? Is the error normal (expected), Please enlighten me? Thank you. Link to comment Share on other sites More sharing options...
lewster32 Posted September 12, 2014 Share Posted September 12, 2014 This is normal - Chrome and some other browsers can now optionally download a .map file when your developer console is open, which allows you to more easily debug a minified JavaScript file. If it isn't present you'll get a 404 error but the program will work as normal still. Also, normal users not using developer tools won't send this request and so it won't be a problem. For development you should really be using the non-minified version of Phaser just so this step doesn't have to be taken. DiegoMontania, clark and tidelake 2 1 Link to comment Share on other sites More sharing options...
clark Posted September 12, 2014 Share Posted September 12, 2014 Thanks Lewster, I always wondered about that. Link to comment Share on other sites More sharing options...
rich Posted September 12, 2014 Share Posted September 12, 2014 If you want to fix the error there is a phaser.map file in the build folder of the repo. Link to comment Share on other sites More sharing options...
hyude Posted September 12, 2014 Author Share Posted September 12, 2014 Thank you for your response. So I should use the full source version during development, and then switch on the minified during release? However, in tutorial, they use minified version, thus only include 1 file in index.html. If I use full source, how do I include the whole file? Link to comment Share on other sites More sharing options...
lewster32 Posted September 12, 2014 Share Posted September 12, 2014 You don't need to include the individual files version of the source, just use phaser.js instead of phaser.min.js. Link to comment Share on other sites More sharing options...
Nepoxx Posted September 12, 2014 Share Posted September 12, 2014 If you don't plan on using the map to debug, you can prevent this behavior by removing the following comment from the minifed source: //@ sourceMappingURL=phaser.map Actually, you should remove that line from production code as it will prevent a totally unnecessary http get call (not that is it expensive, however). Dread Knight 1 Link to comment Share on other sites More sharing options...
Recommended Posts