fsprojects / FSharp.UMX

F# units of measure for primitive non-numeric types
MIT License
154 stars 10 forks source link

`Object(...) is not a function` when using Guid custom measure #24

Closed TerenceHinrichsen closed 2 years ago

TerenceHinrichsen commented 2 years ago

While trying to implement measures for specific types I am getting an exception when calling from JS I have a custom measure implemented as

  [<Measure>] type branchGuid
  type BranchGuid = Guid<branchGuid>

using FSharp.UMX I have a Fable.Remoting type setup with an Elmish frontend and Saturn on the server side (Safe Stack) My tests pass, so I am able to read/write the UMX from my database, however, when I get a record back from Fable.Remoting with the UMX type in, I get an exception Object(...) is not a function

Also, during compiling, the fable compiler warns (not error) export 'branchGuid$reflection' was not found in './Domain.Common.Branch.fs.js'

I feel completely out of my depth, this issue seems to have resolved the issue in 2020. Any idea what I am doing wrong?

TerenceHinrichsen commented 2 years ago

Sorry, asking this on Fable Compiler repo rather...