Heads up! We're sunsetting this forum to streamline our community space.

join us on Discord for support, updates, and all things Snap AR! See you there!
Sign up for our live Camera Kit office hour on July 17 @ 9:30am (PT) / 4:30pm (GMT)

CameraKit for Web & Angular Failure to Import

alex_doudnikov
alex_doudnikov Posts: 14 🔥

Hi Everyone,

I'm using angular and express on node LTS 18.16.0. (It would help to have what verisons of what to have on the docs in case this is the issue.)

I'm following along the bootstrapping guide and ran into a few errors I can't solve. The errors seem to appear when I import camerakit, before I use any functions.

When I import camerakit into my typescript file I get a long list of errors:

Errors: https://gist.github.com/PT-Alex/e7d86c5854f233fe63b335f1be585610

TS File: https://gist.github.com/PT-Alex/30328f5f0310c97a9bedb2f9077bdb37

HTML File: https://gist.github.com/PT-Alex/70b6a9e834448bf7652c12115ea83f68

Project.json: https://gist.github.com/PT-Alex/fb444fb8458b0c1f48d091108d393743

Any help would be appreciated. Thanks.

Tagged:

Comments

  • stevenxu
    stevenxu Posts: 612 👻

    @alex_doudnikov Thanks for posting on the forum! Confirming receipt and shared with the team to investigate. In the meantime, I'll open a direct message just to verify your access as I'm having trouble finding you in our system.

  • Michael Mase
    Michael Mase Posts: 66 🔥🔥

    Hi @alex_doudnikov! Thanks for sharing your sample code. Camera Kit has no default exports. Members should be imported directly. Example:

    import { bootstrapCameraKit, createUserMediaSource } from '@snap/camera-kit';
    

    Additionally, be sure you have "skipLibCheck": true added to compilerOptions in your tsconfig.json; otherwise, you may get type errors within the library itself.

  • alex_doudnikov
    alex_doudnikov Posts: 14 🔥

    The thing that got it working was that "skipLibCheck" in the tsconfig, thanks!

  • stevenxu
    stevenxu Posts: 612 👻

    @alex_doudnikov Thanks for closing the loop!

Categories