You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
implicit conversion import error when DateTime promoted to DateTimeOffset #3908
When a DateTime gets implicitly converted to a DateTimeOffset, the import op_Implicit is missing in the js library:
SyntaxError: The requested module 'https://fable.io/repl/js/repl/fable-library-js/DateOffset.js' does not provide an export named 'op_Implicit' (at 0110e4f1-0010-49d1-b621-0c084f71ae75:62:10)
I've submitted a fix for this issue. The root cause is exactly as @MangelMaxime identified: op_Implicit falls through to the catch-all handler in dateTimeOffset replacements, which generates import { op_Implicit } from "…/DateOffset.js" — but that function doesn't exist.
Fix: Added an explicit "op_Implicit" case in src/Fable.Transforms/Replacements.fs that redirects to the existing fromDate function (the same one used by the .ctor path when a DateTime argument is passed):
|"op_Implicit"->
Helper.LibCall(com, moduleName,"fromDate", t, args, i.SignatureArgTypes, ?loc = r)|> Some
A draft PR has been opened with this change and a test that verifies the round-trip let dto: DateTimeOffset = d → dto.UtcDateTime = d.
Activity
MangelMaxime commentedon Sep 29, 2024
I think we can just alias to
op_ImplicittofromDate:We can do it directly in the
Replacementmodule to avoid having a new function infable-library, I will have a look at it later.Fix implicit DateTime→DateTimeOffset conversion emitting missing op_I…
github-actions commentedon Mar 18, 2026
🤖 This is an automated response from Repo Assist.
I've submitted a fix for this issue. The root cause is exactly as
@MangelMaximeidentified:op_Implicitfalls through to the catch-all handler indateTimeOffsetreplacements, which generatesimport { op_Implicit } from "…/DateOffset.js"— but that function doesn't exist.Fix: Added an explicit
"op_Implicit"case insrc/Fable.Transforms/Replacements.fsthat redirects to the existingfromDatefunction (the same one used by the.ctorpath when aDateTimeargument is passed):A draft PR has been opened with this change and a test that verifies the round-trip
let dto: DateTimeOffset = d→dto.UtcDateTime = d.