I'm trying to follow the instructions <https://kot...
# webassembly
d
I'm trying to follow the instructions https://kotlinlang.org/docs/wasm-js-interop.html#functions-with-the-jsexport-annotation to call wasm functions from javascript. It works as intended until i include npm modules like uuidv4 and js-joda my
mjs
file looks like
Copy code
import * as Li9za2lrby5tanM from './skiko.mjs';
import * as _ref_QGpzLWpvZGEvY29yZQ_ from '@js-joda/core';
import * as _ref_QGpzLWpvZGEvdGltZXpvbmU_ from '@js-joda/timezone';
import * as _ref_dXVpZHY0_ from 'uuidv4';
import { instantiate } from './composeApp.uninstantiated.mjs';


const exports = (await instantiate({
    './skiko.mjs': Li9za2lrby5tanM,
    '@js-joda/core': _ref_QGpzLWpvZGEvY29yZQ_,
    '@js-joda/timezone': _ref_QGpzLWpvZGEvdGltZXpvbmU_,
    'uuidv4': _ref_dXVpZHY0_
})).exports;

export const {
    sayHello,
    memory,
    _initialize,
    startUnitTests
} = exports;
I'm trying to consume
sayHello
with a module like
Copy code
<script type="module">
        import {sayHello } from "./composeApp.mjs"
        sayHello()
    </script>
but receive the error
Copy code
Failed to resolve module specifier "@js-joda/core". Relative references must start with either "/", "./", or "../".
which makes sense because the browser doesn't know what an NPM module is..
1
I see there are two composeApp.mjs loaded and its grabbing the wrong one?