Fable: fable-compiler-js not working on Windows

Created on 17 Dec 2018  ·  5Comments  ·  Source: fable-compiler/Fable

Description

I've tried to compile from F# with fable-compiler-js npm package.

Repro code

dotnet new classlib -o src -n App -lang F#

Changed Library.fs to

module App.Entry

printfn "no dotnet"

npx fable .\src\App.fsproj out

Expected

Output would be JavaScript file with that console.log statement.

Actual results

PS C:\temp\js-f> npx fable .\src\App.fsproj out
Cannot find type System.Linq.IQueryable`1
Cannot find type System.Linq.Expressions.Expression`1
Cannot find type System.ArgIterator
Cannot find type System.Runtime.CompilerServices.IDispatchConstantAttribute
Cannot find type System.Runtime.CompilerServices.IUnknownConstantAttribute
Cannot find type System.Runtime.InteropServices.DllImportAttribute
Cannot find type System.Runtime.InteropServices.ComImportAttribute
Cannot find type System.Runtime.InteropServices.MarshalAsAttribute
Cannot find type System.Runtime.InteropServices.OptionalAttribute
Cannot find type System.Runtime.InteropServices.DefaultParameterValueAttribute
Cannot find type System.Runtime.InteropServices.PreserveSigAttribute
--------------------------------------------
InteractiveChecker created in 2328 ms
Project: App.fsproj, FCS time: 75 ms
--------------------------------------------
Error: File \src/Library.fs doesn't belong to parsed project (\src/Library.fs)

Related information

  • Fable version (dotnet fable --version): "fable-compiler-js": "1.0.0-alpha-008"
  • Operating system: Windows 10

I know this stuff is alpha and I'm just letting you guys know what my findings are.
Low prio to solve this one, as I was merely to curious to check it out.

Most helpful comment

@alfonsogarciacaro I made it go away.

All 5 comments

@ncave has been so kind to fix this :) @nojaf Can you please try with 1.0.0-alpha-009?

Sorry! I made a mistake when publishing 🤦‍♂️ Please try with 1.0.0-alpha-010.

Works with 010! Thanks @ncave and @alfonsogarciacaro.
I still have

$ C:\temp\js-f\node_modules\.bin\fable .\src\App.fsproj out
Cannot find type System.Linq.IQueryable`1
Cannot find type System.Linq.Expressions.Expression`1
Cannot find type System.ArgIterator
Cannot find type System.Runtime.CompilerServices.IDispatchConstantAttribute
Cannot find type System.Runtime.CompilerServices.IUnknownConstantAttribute
Cannot find type System.Runtime.InteropServices.DllImportAttribute
Cannot find type System.Runtime.InteropServices.ComImportAttribute
Cannot find type System.Runtime.InteropServices.MarshalAsAttribute
Cannot find type System.Runtime.InteropServices.OptionalAttribute
Cannot find type System.Runtime.InteropServices.DefaultParameterValueAttribute
Cannot find type System.Runtime.InteropServices.PreserveSigAttribute
--------------------------------------------
InteractiveChecker created in 888 ms
Project: App.fsproj, FCS time: 162 ms
--------------------------------------------
File: src/Math.fs, Fable time: 39 ms
File: src/Library.fs, Fable time: 30 ms
Done in 2.19s.

But compilation does work. Each file in my fsproj was compiled individually.
I don't mind this however how does this related to fable-splitter?
Are the --options the same then?

Yes, we should hide those logs somehow :) Maybe @ncave can make this line dependent on a "verbose" flag or something?

Because fable-compiler-js is pure JS, it doesn't rely on JS clients atm. Think of it for now as a fusion of fable-compiler and fable-splitter (though options are not the same). But yes, we're discussing right now how to restructure the repo to share more code between the different components and make everything more maintainable.

@alfonsogarciacaro I made it go away.

Was this page helpful?
0 / 5 - 0 ratings