Hi, I am trying to embed a ShapeDiver file into a website, but can’t build the dist bundle needed. I have followed the instructions on the ShapeDiver website (Installation Guide for the npm installation, and Viewer to copy the index.ts code). But when I try the “npm run build” command, I get the following error messages:
So I created all the files the error message mentions as empty files, just to see what would happen. It seems to work, a dist folder is created, but obviously only containing an empty main file.
What am I missing to make it work?
Hello @Serena_Loggia,
did you follow our guide here to do that? I just tried it again to rule out any changes from updates and everything seems to work just fine. I also attached my index.html and index.ts files for you so can try it with them. (I had to upload the index.ts as a text file, you can just change the file ending back)
index.html (308 Bytes)
index.txt (656 Bytes)
This is how my folder structure looks like, make sure to check if yours is the same:
Besides that, also make sure your npm verison is the same, I’m currently using 8.5.5
so it worked with that version.
Aside from that, I’ll have to point you towards the documentation of wepback as these kind of issue are not anymore anything that is related to ShapeDiver, but are just general web development problems.
Cheers, Michael
Hi Michael
I re-tried it from the start and it actually worked, it created the dist folder with the bundle.js and the bundle.js.LICENSE.txt, no idea why it didn’t before… Thank you! I now have another issue: I tried localhosting from the root folder, and the following error message: “Loading module from “http://localhost:8000/bundle.js” was blocked because of a disallowed MIME type (“text/html”)”. I am currently looking for solutions online, maybe you’re familiar with this issue?
In any case, thanks!
Cheers, Serena