Developer Debugging

Common errors and debugging solutions for Onairos integration.

Updated 27 December 2024
debuggingerrorstroubleshooting

Errors and Debugging

All errors from the Inference API follow this format:

res.status(statusCode).send({ error: message });
Status Codes

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

StatusMeaningAction
200SuccessProcess the response data
400Bad RequestCheck your request body format
401UnauthorizedVerify your access token
403ForbiddenCheck domain registration
413Payload Too LargeReduce input data size
500Server ErrorContact support
Need more help?

If you're still experiencing issues, email support@onairos.uk with your error details and we'll help you debug.