Can't run example-sim offline on Linux Debian 11

Skip to first unread message

Jun 4, 2023, 2:20:54 PM6/4/23
to Developing Interactive Simulations in HTML5
I'm trying to run the example-sim on Linux Debian 11 without success I hope you can help me.

I followed the instructions on and also installed the Apache 2 package and created a symbolic link for my PHETsims simulations directory to get access from the localhost.

When trying to run de example-sim I get the following error message on the firefox Web Developer Tools window (see image below):

Loading module from “http://localhost/PHETsims/chipper/dist/js/joist/js/simLauncher.js” was blocked because of a disallowed MIME type (“text/html”).

I also created the .htaccess file on my local host directory with the following content without success

AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
AddType image/x-icon .ico
AddType application/javascript .js
AddType application/json .json
AddType text/html .html .htm

Here is a screen image of my browser with the error message:

Jun 11, 2023, 3:46:47 PM6/11/23
to Developing Interactive Simulations in HTML5

I can't really help you with your apache server and permissions, but you should know that there are less cumbersome alternatives to run a local server.

Part of the instructions from state 
(3) Change directory to chipper cd ../chipper/, then transpile the code to JavaScript by running node js/scripts/transpile.js --watch. This starts a file-watching process that will automatically transpile new or changed files.

(4) In a new terminal/command prompt, start an http-server

(5) Open in the browser: http://localhost/example-sim/example-sim_en.html (You will probably need to modify this URL based on your HTTP port and relative path.)

Although there are no explicit directions about how to start an http-server, a convenient way is to use
Using npx you can start a local server without installing it first:
npx http-server

The server should be run from the root directory of the phet simulations which is `PHETsims` in your particular case.

I hope that helps.

Martin Veillette
Reply all
Reply to author
0 new messages