Scene upload failed: invalid resource contentType when a .js file is in the scene folder

I’m trying to add custom functionality to my scene using JavaScript, but I’m running into an upload issue.
When you try to upload a scene with .js files placed in the extra-assets folder, etc., it fails with the following error message.
Scene upload failed: invalid resource contentType
However, if you remove the .js file from the folder, the scene uploads successfully without any issues.
Is this behavior intentional? Is it not permitted to directly upload .js files as scene assets?
If so, what is the official recommended method for including custom JavaScript in Shapespark scenes?

If you’re on the Plus or Premium plan, you can add your own HTML or JavaScript to a Shapespark scene. Just create a file named body-end.html in the folder:

Documents\Shapespark\YOUR_SCENE_NAME\

Anything you put in body-end.html will be automatically inserted into the scene’s index.html file right before the closing </body> tag.

1 Like