{"id":25563,"library":"fable-compiler-dotnet","title":"Fable","description":"Fable is an F# to JavaScript/TypeScript/Python/Dart/Rust/Erlang compiler. The current stable release is 4.29.0 with 5.0.0 in release candidate (rc.7). It is under active development, releasing multiple alpha/rc versions per month. Key differentiators: single codebase compiles to multiple targets, supports F# quotations, integrates with .NET tooling via dotnet CLI. The compiler is distributed as a .NET tool via NuGet.","status":"active","version":"2.1.0-alpha-001","language":"javascript","source_language":"en","source_url":"https://github.com/fable-compiler/Fable","tags":["javascript","fable","fsharp","F#"],"install":[{"cmd":"npm install fable-compiler-dotnet","lang":"bash","label":"npm"},{"cmd":"yarn add fable-compiler-dotnet","lang":"bash","label":"yarn"},{"cmd":"pnpm add fable-compiler-dotnet","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Fable.Cli is the package for the dotnet tool; 'Fable' package is the compiler library.","wrong":"#r \"nuget: Fable\"","symbol":"Fable.Cli","correct":"#r \"nuget: Fable.Cli\"\nopen Fable.Cli"},{"note":"Fable.Core provides F# attributes like [<Emit>] and JS interop. Not needed for simple compilation.","wrong":"#r \"nuget: Fable\"","symbol":"Fable.Core","correct":"#r \"nuget: Fable.Core\"\nopen Fable.Core"},{"note":"Built-in F# value, not an import.","wrong":null,"symbol":"__SOURCE_DIRECTORY__","correct":"let dir = __SOURCE_DIRECTORY__"}],"quickstart":{"code":"#r \"nuget: Fable.Cli\"\nopen Fable.Cli\n\nlet output = \n    {\n        Fable.CompilerOptions.Create() with\n            file = __SOURCE_FILE__\n            outDir = \"./output\"\n            lang = Fable.Language.JavaScript\n    }\nFable.Cli.compile output |> Async.RunSynchronously\n|> function\n| Ok _ -> printfn \"Compilation succeeded\"\n| Error exn -> printfn \"Error: %s\" exn.Message","lang":"fsharp","description":"Compiles the current F# file to JavaScript using Fable.Cli NuGet package."},"warnings":[{"fix":"Replace 'fable' with 'dotnet fable' in scripts and CI.","message":"Fable 5.0.0 renames the 'fable' command to 'fable-cli'. Use 'dotnet fable'.","severity":"breaking","affected_versions":">=5.0.0-rc.1"},{"fix":"Review output directory structure and imports.","message":"Fable 5.0.0 changes default output format for Python/Beam targets; check generated files.","severity":"breaking","affected_versions":">=5.0.0-rc.1"},{"fix":"Migrate to Fable.Cli with 'dotnet fable'.","message":"Fable 3.x 'fable-splitter' is deprecated; use Fable.Cli directly.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Replace [<Emit>] with platform-specific interop attributes.","message":"Fable.Core.Emit attribute does not work with Fable 5 Python/Beam targets; use Fable.Core.JsInterop instead.","severity":"gotcha","affected_versions":">=5.0.0-rc.1"},{"fix":"Use FSharp.Core's List or Array for structural equality, or implement custom equality.","message":"ResizeArray equality uses reference equality in Fable 5 for all targets; .NET uses structural equality.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Test your F# code against Fable's supported API subset.","message":"Fable does not support all .NET APIs; especially reflection and AppDomain.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add '#r \"nuget: Fable.Cli\"' before using Fable.Cli module.","cause":"Missing reference to Fable.Cli NuGet package.","error":"The type 'Fable.Cli' is not defined"},{"fix":"Upgrade to Fable >=5.0.0-rc.1 to use '--lang beam'.","cause":"Using an older Fable version that doesn't support BEAM/Erlang target.","error":"Unknown language 'beam'"},{"fix":"Use platform-specific interop or Fable.Core.JsInterop.","cause":"Using [<Emit>] attribute with Python or BEAM target.","error":"Fable.Core.Emit does not support this target"},{"fix":"Ensure you have added Fable.Library NuGet package and restored.","cause":"Missing Fable library runtime files.","error":"Fable: Could not find 'fable-library.js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}