Manipulate HDF5 and load library on Cesium app local

To manipulate .hdf5 files i need to use either jsfive or h5wave library. And i don’t know why but use the static method to import the library send back the message:

import hdf5 from ‘https://cdn.jsdelivr.net/npm/h5wasm@latest/dist/esm/hdf5_hl.js’;
—> Uncaught SyntaxError: Cannot use import statement outside a module

So I change the module status but i have the same results:

Maybe because it’s an local app or idk

If you have some documentation or some clues, i’ll be gratful

Hello! h5wasm developer here. The very top of your app is problematic… you can’t import mathjs as a style, and the URL for the mathjs CDN is incorrect.

h5wasm is not designed to be loaded into a global context in the ESM form - if you want to use the module library, you should import it in your script directly instead of in a script tag, e.g.

import h5wasm from "https://cdn.jsdelivr.net/npm/h5wasm@latest/dist/esm/hdf5_hl.js";

// the WASM loads asychronously:
await h5wasm.ready;

Alternatively, if you want to use a script tag, use the IIFE version like this:

<script src="https://cdn.jsdelivr.net/npm/h5wasm@latest/dist/iife/h5wasm.min.js"></script>

Then you can use the h5wasm package directly e.g. const f = new h5wasm.File("geodata.h5", "r")

Hope it works for you!