Jump to content

[Ask] Error Get phaser.Map


hyude
 Share

Recommended Posts

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

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.

Link to comment
Share on other sites

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

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).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...