Troubleshooting
Widget Issues
Widget doesn't appear
- Check your app ID – Ensure
NEXT_PUBLIC_YAK_APP_IDor equivalent is set correctly - Verify YakWidget is inside YakProvider – The widget must be a child of the provider
- Check for JavaScript errors – Open browser console for any errors
// ✓ Correct
<YakProvider appId="your-app-id" {...props}>
<YakWidget />
</YakProvider>
// ✗ Wrong - widget outside provider
<YakProvider appId="your-app-id" {...props}>
{children}
</YakProvider>
<YakWidget />Widget loads but doesn't respond
- Check API endpoints – Verify your GET and POST handlers return correct responses
- Check network tab – Look for failed requests to
/api/yakor your config/tools endpoints - Verify CORS – If using separate origins, ensure CORS is configured
Styles are broken
- Check CSS loading – Ensure Tailwind/CSS is loaded in your layout
- Check z-index conflicts – The widget uses high z-index values; ensure nothing is covering it
- Theme configuration – Verify your theme prop is correctly structured
API Handler Issues
404 on config/tools endpoints
- Check route path – Ensure the route file matches your endpoint
- Next.js:
app/api/yak/[[...yak]]/route.ts - Remix:
app/routes/api.yak.ts
- Next.js:
- Check export names – Handlers must export
GETandPOST - Verify the path in client – Match
getConfigandonToolCallendpoints
GET returns empty routes
- Check route sources – Verify your route array or sources are populated
- For Next.js auto-scan – Ensure
appDirpath is correct - Check route filter – Your include/exclude patterns may filter everything
POST returns tool errors
- Check tool name – Tool names are case-sensitive
- Verify tool is in manifest – Confirm the tool appears in GET response
- Check input validation – Ensure args match the tool's input schema
- Review executor logs – Add logging to your
executeToolfunction
tRPC Adapter Issues
Procedures not appearing
- Check allowedProcedures – If using
allowedProcedures, procedure must be in the whitelist - Check disallowedProcedures – If using
disallowedProcedures, ensure procedure is not blocked - Verify procedure path – Use the full path (e.g.,
orders.list, not justlist) - Check router exports – Ensure procedures are exported from your router
Context errors
- Verify createContext – Ensure it returns the expected shape
- Check authentication – If procedures require auth, verify it's passed correctly
- Review tRPC errors – Check server logs for validation or context errors
// Ensure your context factory handles missing request
createContext: async (opts) => {
// opts.req may be undefined in some contexts
return createContext(opts?.req);
}Programmatic API Issues
openWithPrompt doesn't work
- Verify provider –
useYakmust be called insideYakProvider - Check timing – Prompts are queued if called before iframe is ready
- Verify widget state – Check
isOpenorisWidgetOpento see current state
Navigation doesn't work
- Provide onRedirect – Without it, navigation falls back to
window.location.href - Use correct router – Pass your router's navigate function
- Check path format – Paths should start with
/
// React Router
<YakProvider onRedirect={(path) => navigate(path)} />
// Next.js
const router = useRouter();
<YakProvider onRedirect={(path) => router.push(path)} />Performance Issues
Widget is slow to load
- Use lazy loading – Consider
client:idlein Astro or dynamic imports - Check config endpoint – Ensure GET handler responds quickly
- Minimize route/tool count – Large manifests slow down processing
Tool calls are slow
- Add caching – Cache expensive operations where appropriate
- Batch requests – Combine multiple database queries
- Check N+1 patterns – Avoid fetching related data in loops
Common Error Messages
"Unknown tool: xxx"
The tool name in the POST request doesn't match any defined tool.
- Check tool names in your manifest
- Verify the correct adapter is handling the call
"Not authorized"
Authentication is failing.
- Check your session/token handling
- Verify auth is passed through to your handlers
"Failed to fetch config"
The GET endpoint is unreachable.
- Check the endpoint URL in
getConfig - Verify the server is running
- Check for CORS issues
Still stuck? Check the browser console and server logs for more detailed error messages.