Closed mastoj closed 8 years ago
Sorry, I cannot reproduce the error (both Option.bind
and Option.map
work for me). Could you please give more details about the problem?
Option.bind
, Option.map
, or both?i
variable is not defined).Thanks!
Sorry, it should have been a number and not i. The problem is that it didn't compile since. I'll check again tomorrow on both Osx and win 10.
The compile error on OSX is:
ERROR: F# project contains errors: The field, constructor or member 'map' is not defined (L44,7-L44,10) (virtualdom.fsx) at Fable.Client.Node.Main.parseFSharpProject (ICompiler com, Microsoft.FSharp.Compiler.SourceCodeServices.FSharpChecker checker, Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectOptions projOptions) <0x5b62668 + 0x0035f> in
:0 at Fable.Client.Node.Main.compile (ICompiler com, Microsoft.FSharp.Compiler.SourceCodeServices.FSharpChecker checker, Fable.FSharp2Fable.FSProjectInfo projInfo) <0x5b62130 + 0x00117> in :0
I updated the sample to something that should compile if map
was defined.
I'll check on windows in a couple of hours.
Fable version: 0.4.4
I updated the error branch : https://github.com/mastoj/Fable/tree/optionbinderror?files=1
I have the same error on Windows with fable 0.4.5.
ERROR: F# project contains errors: The field, constructor or member 'map' is not defined (L44,7-L44,10) (virtualdom.fsx)
Thanks for the additional info! The message F# project contains errors
indicates the errors are coming from the F# compilation itself, not from Fable. In this case, unfortunately Fable.Import.Browser
contains an Option
member which overrides the F# Option
module. The solution is not to open Fable.Import.Browser
and use the full name whenever needed (e.g. Browser.window.setTimeout
).
I see. Thank you for clarifying. I should have figured that one out myself :)
On Fri, Jul 29, 2016 at 11:39 AM, Alfonso Garcia-Caro < notifications@github.com> wrote:
Thanks for the additional info! The message F# project contains errors indicates the errors are coming from the F# compilation itself, not from Fable. In this case, unfortunately Fable.Import.Browser contains an Option member which overrides the F# Option module. The solution is not to open Fable.Import.Browser and use the full name whenever needed (e.g. Browser.window.setTimeout).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Fable/issues/290#issuecomment-236138158, or mute the thread https://github.com/notifications/unsubscribe-auth/AAemsFII5_5ps7zcUA7KoxV7-uvFIwrVks5qaco_gaJpZM4JW99c .
When trying to use
Option.bind
I getI haven't pinned it down to why that is, but I created a branch where it is not working, you can find the failing line here: https://github.com/mastoj/Fable/blob/2bbba7e01f1770ea05f0ddb9512541c69394136e/samples/browser/virtualdom/virtualdom.fsx#L44