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
- Fix or delete the malformed .options file; a fresh one with defaults will be written on next import.
- Validate the RON syntax against the current options struct (check field names/types after upgrades).
- 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
- Edit .options files only through the Fyrox editor import dialog.
- After engine upgrades, re-import resources so options structs match the current RON schema.
- Validate hand-written RON with a linter/parser before committing options files.
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Unable to load options file
- Graph pool must be empty on load!
- No id specified for node
- Unable to load script instance of id
- Script instance of id
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)