_This was reported by @tomcl in https://github.com/fable-compiler/Fable/issues/2277#issuecomment-730324828:_
The app used List.distinct on a JS object list. This broke under Fable3 as you can imagine. I used distinctBy and a string id to mend this.
I reduced the repro to this:
obj ()
|> hash
|> System.Console.WriteLine
Works with Fable 2 (REPL), fails with Fable 3 (REPL)and in Node. Node gives a little bit more info than the browser:
G:\experiments\Fable3Playground\dist\main.js:59
const hashes = Object.values(self).map((v) => structuralHash(v));
^
ReferenceError: self is not defined
at structuralHash (G:\experiments\Fable3Playground\dist\main.js:59:46)
at G:\experiments\Fable3Playground\dist\main.js:72:13
at Object.<anonymous> (G:\experiments\Fable3Playground\dist\main.js:74:3)
This affects functions such as List.distinct, because they use structuralHash internally. Not sure if this is expected, though.
Changing self to x in the following line fixes this:
When Typescript cannot catch a mistyping 馃う I'd like that all bug reports came with a fix, thanks a lot @inosik!
When Typescript cannot catch a mistyping
TypeScript is just plain old JavaScript in disguise, so I'm not surprised 馃槃
Fable 3 makes it really easy to set up small repro cases without having to set up a bunch of stuff or to rely on a template 馃憦馃徎
Most helpful comment
TypeScript is just plain old JavaScript in disguise, so I'm not surprised 馃槃
Fable 3 makes it really easy to set up small repro cases without having to set up a bunch of stuff or to rely on a template 馃憦馃徎