<div dir="auto">The problem seems to be I’m sharing code between client and server when i shouldn’t.</div><div dir="auto"><br></div><div dir="auto">Hmm!</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 17, 2023 at 11:30 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr">Any help integrating XMLSerializer into index.mjs referenced by index.html would be appreciated! It's perfectly fine if you start from scratch, but make sure that the result code runs in the browser.  You might even try leaving out the import altogether!<div><br></div><div>I am pretty sure the latest nodejs module is "@xmldom/xmldom".</div><div><br></div><div>Thanks!</div><div><br></div><div>I currently have:</div><div><br></div><div><div>$ cat index.mjs</div><div>import fs from 'fs';</div><div>import dom from "@xmldom/xmldom";</div><div><br></div><div>var ser = new dom.XMLSerializer();</div></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 9, 2023 at 5:15 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr">Here is a basic webpack/babel/express/https example for loading node.js .mjs files with<div><br></div><div>import fs from "fs"</div><div><br></div><div>into the client.</div><div><br></div><div>Let me know if you get any errors.</div><div><br></div><div>If anyone wants to create a tutorial (there are *way* too many options online) or otherwise copy over to X3DJSONLD, let me know.</div><div><br></div><div><a href="https://github.com/coderextreme/fstest" target="_blank">https://github.com/coderextreme/fstest</a><br></div><div><br></div><div>This is up-to-date everything except nodejs, which is at: v18.13</div><div><br></div><div>I'm hoping to progress with X3DJSONLD fairly soon.</div><div><br></div><div>Thanks!</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 23, 2023 at 7:40 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Does anyone know how to use JavaScript server code on client?   I think the answer is Babel.<div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto"><br></div><div dir="auto">John</div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>