FyroxEngine/Fyrox · warning

Malformed options file

Error message

Malformed options file {:?}, fallback to defaults! Reason: {}

What it means

ResourceImporter reads per-resource import options from a companion .options file (RON-serialized). If the file exists but fails to deserialize as the expected options type T, this warning is logged and the importer falls back to default import options. The resource still imports, just not with the intended custom settings.

Solutions

  1. Fix or delete the malformed .options file; a fresh one with defaults will be written on next import.
  2. Validate the RON syntax against the current options struct (check field names/types after upgrades).
  3. Re-import the resource in the editor so a correct options file is regenerated, then reapply custom settings.

Example fix

// malformed texture.options
( compression: "yes please" )
// after — valid RON matching TextureImportOptions
(
    compression: true,
)
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Loading a resource whose sibling options file (path + OPTIONS_EXTENSION) exists but contains invalid RON, wrong fields, or options for a mismatched options type — ron::de::from_bytes::<T> returns Err.

Common situations: Hand-editing .options files and introducing RON syntax errors; engine upgrade changing the options struct so old fields no longer parse; copying .options files between different resource types.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/999ff4f164fd222c. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-resource/src/options.rs:85

{
    fn save(&self, path: &Path) -> bool {
        self.save_internal(path)
    }
}

/// Tries to load import settings for a resource. It is not part of ImportOptions trait because
/// `async fn` is not yet supported for traits.
pub async fn try_get_import_settings<T>(resource_path: &Path, io: &dyn ResourceIo) -> Option<T>
where
    T: ImportOptions,
{
    let settings_path = append_extension(resource_path, OPTIONS_EXTENSION);

    match io.load_file(settings_path.as_ref()).await {
        Ok(bytes) => match ron::de::from_bytes::<T>(&bytes) {
            Ok(options) => Some(options),
            Err(e) => {
                Log::warn(format!(
                    "Malformed options file {:?}, fallback to defaults! Reason: {}",
                    settings_path, e
                ));

                None
            }
        },
        Err(e) => {
            // Missing options file is a normal situation, the engine will use default import options
            // instead. Any other error indicates a real issue that needs to be highlighted to the
            // user.
            if let FileError::Io(ref err) = e {
                if err.kind() == ErrorKind::NotFound {
                    return None;
                }
            }

            Log::warn(format!(

View on GitHub (pinned to 76c91aad8e)