Repository navigation
Troubleshooting
github-actions[bot] edited this page Oct 12, 2026
·
4 revisions
Cause:
- Converter expects exactly one CLI argument.
Fix:
haxelib run ax4 config.jsonCause:
- Required config field missing.
Fix:
- Add all required keys to
config.json. - Validate JSON syntax.
Cause:
- File in
swcis not a valid SWC archive (or wrong file path).
Fix:
- Verify the file is an SWC.
- Verify path and slash style.
Cause:
-
skipFilesuses exact path matching.
Fix:
- Use exact walked file path format.
- Prefer forward slashes in config values.
Cause:
-
keepTypesinfluences type hint omission in generated vars.
Fix:
- Set
"keepTypes": trueto preserve hints. - Set
"keepTypes": false(or omit) to allow cleaner inferred output.
Cause:
- The AS3 is untyped there (
*,Object, untypedArrayorDictionary), so ax4 keeps AS3's dynamic semantics.
Fix:
- Type the AS3 where you can, or add comment type hints to the AS3 sources (see Config reference).
Cause:
- Loop rewrite depends on inferred iteratee type and
settings.checkNullIteratee.
Fix:
- Try enabling/disabling
settings.checkNullIteratee. - Inspect generated imports for
ASCompat.checkNullIteratee.
Typical symptoms:
-
Type not found/Unknown identifierin generated.hx - Missing members after conversion (
field ... is not found) - Errors around AS3 runtime concepts (
Dictionary, XML, dynamic access, Proxy-like behavior) - Missing classes from external SDKs/extensions
Common causes and fixes:
-
Pattern not handled (or partially handled) by current filters
- Cause: generated Haxe is syntactically valid, but semantic rewrite is incomplete for this AS3 construct.
- Fix:
- Reduce to the smallest reproducible AS3 sample in
tests/src/. - Name it according to conventions (
TestFilter...for filter-specific cases). - Add comments describing expected output/behavior.
- Implement or adjust filter/typer logic, then re-run converter.
- Reduce to the smallest reproducible AS3 sample in
-
compat/runtime not included in the target Haxe project- Cause: converted code references compatibility helpers that are not on classpath.
- Fix:
- With the haxelib install, add
-lib ax4to the build. - Otherwise, copy
compat/into your output project (for example with thecopyconfig option) and add it to the build classpath.
- With the haxelib install, add
-
External dependency mismatch (SWC / ANE / platform libs)
- Cause: conversion used SWC declarations, but compile target does not provide equivalent Haxe-side types/runtime.
- Fix:
- Verify required SWCs are listed in converter config (
swc) so typing is correct. - Verify target project has corresponding Haxe libraries/externs.
- For ANE/native APIs, provide or adapt extern wrappers on the Haxe side.
- Verify required SWCs are listed in converter config (
-
Project integration mismatch after generation
- Cause: generated sources compile in isolation but fail in the real project due to classpath/import/config differences.
- Fix:
- Compare your real project settings with the minimal test setup.
- Check generated
import.hxandrootImportsusage. - Use
haxeTypesoverrides when specific external signatures need correction.
Recommended diagnostic workflow:
- Fix the first compile error first (later errors are often cascades).
- Open the generated
.hxline reported by compiler and map it back to source AS3. - Classify the issue quickly:
- missing compat,
- missing extern/library,
- unsupported rewrite pattern.
- If it is a converter issue, create a focused repro in
tests/src/and iterate there before patching production code.
Cause:
- ax4 reports many non-fatal warnings (dynamic ops, untyped calls, local inference on vars, etc.) while still converting.
What to do:
- Scroll to the end of the run: after
-- TOTAL, a diagnostics summary lists each warning kind with a count. - Use Diagnostics for meaning and recommendations.
- Grep the per-line stderr log only for kinds you care about (or for a specific
.asfile).
Cause:
-
formatteroption shells out tohaxelib run formatterand does not hard-fail conversion output.
Fix:
- Run formatter manually to inspect errors.
- Ensure formatter is installed and available to
haxelib.