Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing JavaScript Let's Make a Game The Language of Programming

'Security' error when trying to load phaser.js file

I keep getting a security error whenever I try to load the phaser.js file in the course.

It says (error SecurityError) verbatim.

2 Answers

Hi Dave, I did not download the files, just tried to launch the workspace in the browser. I downloaded the web server for Chrome....but there are no instructions in that link...The game is working now however. Thanks.

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Ricardo Redd

You can get that error if you downloaded the files to your computer, and tried to open the index.html file in a browser. Many browsers limit how JavaScript interacts with your local file system, and loading files the way Phaser.js, will trigger an error, unless you view the web page from a web server. If you use workspaces to edit and view the files you won't get that error.

Another option is to load a simple web server on your computer and view the game page that way. A really simple way, if you use the Chrome browser, is to use the Web Server for Chrome extension. Just follow the instructions on the page -- https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en -- and you'll be able to view the game just fine.