Developer Debugging
Common errors and debugging solutions for Onairos integration.
Errors and Debugging
All errors from the Inference API follow this format:
res.status(statusCode).send({ error: message });
Statuses of 200 are valid. All other status codes indicate potential issues.
Common Issues and Solutions
ā Issue 1: Extension closes immediately after opening
Problem
The Onairos Extension closes immediately after opening.
Solution
Ensure you have registered your App domain in your Onairos development account at onairos.uk/dev-board.
ā Issue 2: MIME type error
Problem
Error: Refused to execute because its MIME type (text/html) or similar.
Cause
The Onairos package uses dynamic imports to reduce package size. This error means your app is not copying the import chunks (sha-256 and othent/kms) from the onairos node modules folder to your build folder.
Solution
If using webpack or similar builds, use react-app-rewired with this config-overrides.js:
const CopyPlugin = require('copy-webpack-plugin');
module.exports = function override(config, env) {
// Skip in development mode
if (env === 'development') {
return config;
}
// Add CopyPlugin to copy Onairos chunks
config.plugins = (config.plugins || []).concat([
new CopyPlugin({
patterns: [
{
from: 'node_modules/onairos/dist/*.chunk.js',
to: 'static/js/[name][ext]'
},
],
}),
]);
return config;
};
Error Response Format
| Status | Meaning | Action |
|---|---|---|
| 200 | Success | Process the response data |
| 400 | Bad Request | Check your request body format |
| 401 | Unauthorized | Verify your access token |
| 403 | Forbidden | Check domain registration |
| 413 | Payload Too Large | Reduce input data size |
| 500 | Server Error | Contact support |
If you're still experiencing issues, email support@onairos.uk with your error details and we'll help you debug.