David Breneisen
08/19/2025, 9:13 PMDavid Breneisen
08/19/2025, 9:14 PMimport exports from "./module.mjs"
but it doesn't say where. I'm not a web developer so this is where it gets more confusing for me but I've come to adding this in order to attach the function to the window object so I can invoke it from the google data-callback function:
<script type="module">
import exports from "./composeApp.mjs"
window.authGoogleLoginComplete = exports.authGoogleLoginComplete;
</script>
I changed it to ./composeApp.mjs since there is no module.mjs file, but I did find this file being generated that includes the export for my function:
import * as Li9za2lrby5tanM from './skiko.mjs';
import * as _ref_QGpzLWpvZGEvY29yZQ_ from '@js-joda/core';
import { instantiate } from './composeApp.uninstantiated.mjs';
const exports = (await instantiate({
'./skiko.mjs': Li9za2lrby5tanM,
'@js-joda/core': _ref_QGpzLWpvZGEvY29yZQ_
})).exports;
export const {
authGoogleLoginComplete,
memory,
_initialize,
startUnitTests
} = exports;
But trying to load that file gives me this error:
> Failed to resolve module specifier "@js-joda/core". Relative references must start with either "/", "./", or "../".
So apparently it doesn't like the @js-joda/core path, but that's not something I've added.
To debug I removed the js-joda/core references from the file manually, so that resolves the issue (in an unacceptable way), but then I get another error:
> The requested module './composeApp.mjs' does not provide an export named 'exports'David Breneisen
08/19/2025, 9:40 PM<script type="module">
import { authGoogleLoginComplete } from "./composeApp.mjs"
window.authGoogleLoginComplete = authGoogleLoginComplete;
</script>
so now I'm just left with this @js-joda/core thing since manually deleting for every build isn't really an optionTepes Lucian Victor
09/01/2025, 3:00 PMDavid Breneisen
09/01/2025, 10:48 PMTepes Lucian Victor
09/02/2025, 3:22 PMWebElementView + have the js logic inside calling the kotlin partAndrewStone
10/09/2025, 1:14 AMAndrewStone
10/09/2025, 3:08 PM<head>
<script type="importmap">
{
"imports": {
"@js-joda/core": "<https://cdn.jsdelivr.net/npm/@js-joda/core/+esm>"
}
}
</script>
...
</head>
This points to a standard server for js-joda. We ought to also be able to get it locally since its in ./build/wasm/node_modules/@js-joda, but I haven't figured out how the directory is munged.
Next, you will probably get this error: Element.attachShadow: Unable to re-attach to existing ShadowDOM
This means you've initialized your WASM module (probably composeApp.js) multiple times.
I was unable to pull it in as a normal script like this:
<!--script type="application/javascript" src="composeApp.js"></script -->
(without the comments OFC) and also import my symbols.
However, if I imported it as a module in index.html like this:
<script type="module">
import { createOngoingOp, updateOngoingOp } from './composeApp.mjs';
</script>
(note that createOngoingOp and updateOngoingOp are my @JsExport functions) I was also able to import it into my other module .js files, like this:AndrewStone
10/09/2025, 3:11 PMimport { createOngoingOp, updateOngoingOp } from "./composeApp.mjs";
Note in both cases I'm importing the .mjs NOT the .js file (this is the module wrapper).