I use AI Studio to make many small, simple apps for me and anyone else who is looking for simple tools. Right now, I’m working on a website that uses the video Web API to display MP4 videos and to extract frames from it. (Often just the last frame, so I can use AI to take that frame as the start for a new video.) This works fine.
So, I decided to add a splash screen with a JPF file. This will be served from my server, so the image will be in the /public folder. When I deploy this app to my server, the content of /public will be stored in the root folder, so /video.jpg would be the location.
But the sandbox of AI Studio isn’t that clever. It will look in the root of my source, expecting the image to be there. And the AI is really struggling to get it right, but probably will just keep messing up my code. That’s because it might change the path to /public/video.jpg and then the sandbox works. But my deployed app will then fail. And if the deployed app works, the sandbox might fail.
So, in an attempt to fix this, AI Studio decided to replace video.jpg with a placeholder, hoping that would fix it. Thus further destruction to my app. And if that doesn’t do, the AI will do more creative damage to the app instead.
I did solve this once for another project by using the absolute URL for these files. So add files to /public, deploy to my server and then make the app use the full URL instead of a relative URL.
That’s just ugly, but it works…
.
So, why can’t the sandbox use the /public folder as root?