Uploader Widget Troubleshooting
This guide provides best practices and troubleshooting tips for the CKBox Uploader Widget to help you resolve common issues.
The uploader widget is designed to handle errors and display them to users. When an error occurs:
- The widget will automatically display an error state with a user-friendly message.
- Users will see a clear indication that something went wrong.
- The error dialog will show the error type and a compact message when available.
For detailed error information and debugging:
- Open Developer Tools: Press
F12to open your browser’s debugging tools. - Check Console: Look in the Console tab for detailed error messages.
- Network Tab: Check network requests to identify authentication or API issues.
The developer tools will provide more detailed information than what is displayed in the user interface, making it easier to diagnose and resolve issues.
Symptoms:
- Widget displays error state.
- Console shows authentication errors.
- Network requests return 401/403 status codes.
Solutions:
- Verify the
tokenUrlparameter is correctly set. - Ensure the token endpoint is accessible and returns valid tokens.
- Check that the token URL is using the correct protocol (
https://). - Verify the token endpoint is not blocked by CORS policies.
// Correct token URL format
CKBoxWidget.mountUploaderWidget(document.getElementById('ckbox'), {
tokenUrl: 'https://your-domain.com/api/ckbox/token'
});
Copy code
Symptoms:
- Widget fails to load or shows error state.
- Network requests return 404/403 status codes.
Solutions:
- Verify the
workspaceIdparameter matches your CKBox workspace. - Check that the workspace ID is properly formatted.
- Ensure the workspace exists and is accessible with your token.
- Verify the workspace ID is not empty or undefined.
// Correct workspace ID usage
CKBoxWidget.mountUploaderWidget(document.getElementById('ckbox'), {
tokenUrl: 'https://your-domain.com/api/ckbox/token',
workspaceId: 'your-workspace-id-here'
});
Copy code
Symptoms:
- Widget shows authentication error.
- Console shows 401 Unauthorized errors.
- Token refresh failures.
Solutions:
- Verify token endpoint returns valid JWT tokens.
- Check token expiration and refresh logic.
- Ensure proper authentication headers.
- Verify token has necessary permissions for the workspace.