HTML Components with local js file

You need a server to serve such files especially if they have files included via nested web requests.

Try using components.iframe instead. This post may help.

If your app includes a custom component, then you can use its web server to serve your file from the frontend/public web server folder. See this post for an example.