Just a thought as ES modules are becoming the norm in WEB Development.
Have you tried using
I am terrible at trying to explain things but this may shed some light on things from MDN Web Docs_
Their words not mine::~:// " Aside — .mjs versus .js
Throughout this article, we’ve used
.js extensions for our module files, but in other resources you may see the
.mjs extension used instead. V8’s documentation recommends this, for example. The reasons given are:
- It ensures that your module files are parsed as a module by runtimes such as Node.js, and build tools such as Babel.
However, we decided to keep using
.js, at least for the moment. To get modules to work correctly in a browser, you need to make sure that your server is serving them with a
.js files, but not yet for
.mjs files. Servers that already serve
.mjs files correctly include GitHub Pages and
http-server for Node.js.
This is OK if you are using such an environment already, or if you aren’t but you know what you are doing and have access (i.e. you can configure your server to set the correct
.mjs files). It could however cause confusion if you don’t control the server you are serving files from, or are publishing files for public use, as we are here.
For learning and portability purposes, we decided to keep to
If you really value the clarity of using
.mjs for modules versus using
.mjs during development and convert them to
.js during your build step. "
Good luck with it and I am learning and wish I could be more helpful. But I like these types of issue as a challenge to try and figure out how to make it work. Or find the correct solution that will.
My guess is like NODE a few years was not set to handle modules, SketchUp may be in the same boat. Because you are not running your files inside the web browser, you are running inside of SketchUp ??
If you figure it out let me know and will look for new reply to the thread.