When trying to import depthkit in my project’s index.html I am running into the following error: "Uncaught SyntaxError: The requested module ‘/build/depthkit.js’ does not provide an export named ‘default’ "
I have loaded three js and am referencing the depthkit.js file from the build folder in the project directory as such:
I have also tried which gives me the following error: "Uncaught SyntaxError: Unexpected token ‘export’ (at depthkit.js:445:1) "
I am running my project on a local server.
@SophieLopez - Sorry that you’re having this issue.
Depthkit.js is now a community-maintained project, and has been a challenge to maintain while updates to underlying libraries and dependencies cause the integration to break, as has been seen within other forum threads.
This is one reason why we are moving our web player integration toward streaming mesh sequences for both Depthkit Core and Depthkit Studio captures. You can see a preview of this web integration in action in this post from @Tim’s LinkedIn: Depthkit 1st Party Web Player Preview . Support for this format will be available in the next Depthkit release in the coming weeks.
How are you importing the file into your index.html?
You can see an example of how to include it in the built in example
My guess is that you’re trying to import the build/depthkit.js as an ES module. The build/depthkit.js file is created by Browserify, and is not an ES module.
You can either add it as a script tag directly into your html as is done in the link above, or you could require() it into another script. If you want to use the ESM style import syntax, you’d need to use the src/index.js or src/depthkit.js directly.
Hope this helps!