I am very interested in using html-wasm to deploy marimo, and I am currently working through the issue of accessing data in S3. Since boto3 is not available in Pyodide, I was just going to use the TS client for AWS S3. The setup is working fine for running the JS code from within Pyodide (import js, js.eval, etc.). However, since I'm not very experienced with TS, I'm having trouble loading the client library appropriately.
I have:
# Load the AWS SDK for JavaScript js.self.AWS = await js.eval(""" (async () => {{ import {{ S3Client, GetObjectCommand }} from "@aws-sdk/client-s3";
// Replace with your actual credentials const client = new S3Client({{ region: "{region}", credentials: {{ accessKeyId: "{access_key_id}", secretAccessKey: "{secret_access_key}", sessionToken: "{session_token}", }} }});
return {{ client }}; }})(); """.format( ....
But I get the error: This cell raised an exception: JsException('SyntaxError: Cannot use import statement outside a module')