Registry / devops / fable-compiler-dotnet

fable-compiler-dotnet

JSON →
library2.1.0-alpha-001jsnpmunverified

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.

npm install fable-compiler-dotnet
INSTALL
IMPORT
SIG · FABLE-COMPILER-DOT
F
fable-compiler-dotnet
devopsjavascriptv2.1.0-alpha-001
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Fable.Cli
#r "nuget: Fable.Cli" open Fable.Cli
#r "nuget: Fable"
Fable.Cli is the package for the dotnet tool; 'Fable' package is the compiler library.
Fable.Core
#r "nuget: Fable.Core" open Fable.Core
#r "nuget: Fable"
Fable.Core provides F# attributes like [<Emit>] and JS interop. Not needed for simple compilation.
__SOURCE_DIRECTORY__
let dir = __SOURCE_DIRECTORY__
Built-in F# value, not an import.

Compiles the current F# file to JavaScript using Fable.Cli NuGet package.

#r "nuget: Fable.Cli" open Fable.Cli let output = { Fable.CompilerOptions.Create() with file = __SOURCE_FILE__ outDir = "./output" lang = Fable.Language.JavaScript } Fable.Cli.compile output |> Async.RunSynchronously |> function | Ok _ -> printfn "Compilation succeeded" | Error exn -> printfn "Error: %s" exn.Message
fable --version
Debug
Known issues
breakingFable 5.0.0 renames the 'fable' command to 'fable-cli'. Use 'dotnet fable'.
fix
Replace 'fable' with 'dotnet fable' in scripts and CI.
affects: >=5.0.0-rc.1
breakingFable 5.0.0 changes default output format for Python/Beam targets; check generated files.
fix
Review output directory structure and imports.
affects: >=5.0.0-rc.1
deprecatedFable 3.x 'fable-splitter' is deprecated; use Fable.Cli directly.
fix
Migrate to Fable.Cli with 'dotnet fable'.
affects: >=3.0.0
gotchaFable.Core.Emit attribute does not work with Fable 5 Python/Beam targets; use Fable.Core.JsInterop instead.
fix
Replace [<Emit>] with platform-specific interop attributes.
affects: >=5.0.0-rc.1
gotchaResizeArray equality uses reference equality in Fable 5 for all targets; .NET uses structural equality.
fix
Use FSharp.Core's List or Array for structural equality, or implement custom equality.
affects: >=5.0.0
gotchaFable does not support all .NET APIs; especially reflection and AppDomain.
fix
Test your F# code against Fable's supported API subset.
affects: *
Errors
Common errors & fixes
The type 'Fable.Cli' is not defined
Missing reference to Fable.Cli NuGet package.
fix
Add '#r "nuget: Fable.Cli"' before using Fable.Cli module.
Unknown language 'beam'
Using an older Fable version that doesn't support BEAM/Erlang target.
fix
Upgrade to Fable >=5.0.0-rc.1 to use '--lang beam'.
Fable.Core.Emit does not support this target
Using [<Emit>] attribute with Python or BEAM target.
fix
Use platform-specific interop or Fable.Core.JsInterop.
Fable: Could not find 'fable-library.js'
Missing Fable library runtime files.
fix
Ensure you have added Fable.Library NuGet package and restored.
Upgrade
Version history
2.1.0-alpha-001latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
fable-compiler-dotnet — npm install fable-compiler-dotnet · libregistry