The first problem is the way that script.js
is being loaded. In the cloud editor, app.js
is the entry point for custom javascript.
So, instead of loading a custom javascript file in head.html
with a script
tag:
<script src="script.js"></script>
You should simply import that file in app.js
:
import './script'
But this isn’t the right approach, anyways. The next issue you’d encounter with this approach is that the window load
event would not consistently emit, so the code in script.js
wouldn’t be executed. See here for more information.
The right approach would be to convert script.js
into a 8th Wall camera pipeline module, which you have already started in camerapipeline.js
.