Ammo Error when running locally


I downloaded my project zip and starting it with a local bat file to open chrome with index.html
This works, unless ammo is included in the project.

Fetch API cannot load file://.../../<PATH>/1/ammo.wasm.wasm. URL scheme "file" is not supported.

I think chrome is blocking “file” calls when running a local html file.
I depend on ammo, but i do not depend on the webassembly version.
So i tried to include only the pure js ammo.

  1. deleted ammo.wasm.js and ammo.wasm.wasm
  2. enabled preload on ammo.js

Running playmode now errors with

TypeError: Ammo.btTransform is not a constructor
    at new RigidBodyComponent

Is there a way to force using pure js version of ammo?

The PlayCanvas apps are done in a way that has to be on a server rather than just running the index.html.

I tend to use python simple server as shown here:

Actually that approach always worked for me so far.
I think the only issue is with ammo being webassembly.

Is it possible to include only ammo.js and add it to the resulting html?

Not something I tried before as I’ve always had issues loading without a server

As @yaustar mentioned, you should use a local server. Here is another option, if you don’t want to use python:

Download ZIP build and unzip to some folder. In your command prompt:

// one time only, if haven't installed http-server before
> npm install --global http-server
> cd /where-you-unzipped
> http-server .

You can now open browser at localhost:8080 to see your app.