Error in implementing Depthkit with Threejs no default export

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.

1 Like

Hey @SophieLopez

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!

@SophieLopez Were you able to resolve your issue with Tim’s help?

Also, we have updated the Depthkit.js module to use the streaming geometry export format found in the newest release of Depthkit v0.8.1. This new streaming mesh sequence workflow is used in our 8th Wall templates (single-clip and multi-clip) for both Depthkit Core and Depthkit Studio.

(The legacy Depthkit.js version which uses Depthkit Combined Per Pixel videos has been deprecated.)