join us on Discord for support, updates, and all things Snap AR! See you there!
Get camerakit lens repository timeout issue. Was working before just updated lens and now its broken
Request for https://api-kit.snapchat.com/com.snap.camerakit.v3.Lenses/groups/.../..../ timed out by client timeout handler
I updated the snapchat lens and now I'm getting a timed out issue. I have tested my api ket and lens/group id on the tester and they seem to be working. Does anyone have any insight?
EDIT: I am getting several "the server responded with a status of 404 ()" errors and then the request is timing out.
```useEffect(() => {
const main = async () => {
const apiToken = process.env.REACT_APP_JSON_WEB_TOKEN;
const cameraKit = await bootstrapCameraKit({ apiToken });
const session = await cameraKit.createSession(); session.events.addEventListener("error", (event) => console.error(event.detail)); if (canvasRef.current) { canvasRef.current.replaceWith(session.output.live); } const mediaStream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: { ideal: 'environment' } } }); session.setSource(mediaStream, { cameraType: 'back' }); const lens = await cameraKit.lensRepository.loadLens('...', '...'); await session.applyLens(lens); await session.play(); console.log("Lens rendering has started!"); console.log(canvasRef.current); }; const timeoutId = setTimeout(() => { setShowButton(true); }, 12500); main(); return () => clearTimeout(timeoutId);
}, []);```
Answers
-
@zPoly Thanks for your patience. Here's what our eng shared:
Without seeing the actual error, it's hard to say exactly what's going on. Typically, this error is seen for one of two reasons:
- Not using a version of their app that has Camera Kit enabled
- Not approved for Web SDK use
We can rule out the second one. Did you create a new separate app or use a new organization?
Try this:
- Make sure to use the same organization that you initially selected in the onboarding process.
- Select the same app version that you've used previously (assuming it worked there) and see if the issue still remains.
0 -
@stevenxu Yes I did try those steps and after resetting the camera kit version back to 0.10.0 from 0.11.0 the app is working locally but when I push the app to production on Firebase I am getting the same issues as above. I think there may be some issue with the Snapchat Agree to use policy popup permissions.
The popup is not coming up on the production version and the request for the lenses seems to be timing out without that permission. This is just a guess though as I cannot see any definitive logs.
0 -
Was able to solve this. Apparently, when I changed the lens it somehow messed with the authentication step before the request is sent to get the lens from the server. Anyway I restored my build back to version 0.10.0 and then rebuilt to the server and its working again. Will continue this thread if I change the lens and the issue re-emerges.
1