elmish / hmr

Hot Module Replacement for Elmish apps
https://elmish.github.io/hmr
Other
28 stars 9 forks source link

Needs update for Fable 4 #40

Closed OnurGumus closed 1 year ago

OnurGumus commented 1 year ago

Description

Need update for Fable 4 as it fails below error

/src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/common.fs(64,9): (64,15) error FSHARP: The value or constructor 'ofType' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/common.fs(90,9): (90,15) error FSHARP: The value or constructor 'ofType' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/common.fs(116,9): (116,15) error FSHARP: The value or constructor 'ofType' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(184,12): (184,74) error FSHARP: Type mismatch. Expecting a
    'Program<'arg,'model,'msg,'view> -> Program<'arg,obj,obj,obj>'    
but given a
    '(('msg -> bool) * ('model -> unit) -> (Msg<'msg> -> bool) * (Model<'model> -> unit)) -> Program<'a,'model,'msg,'b> -> Program<'a,Model<'model>,Msg<'msg>,'b>'    
The type 'Program<'arg,'model,'msg,'view>' does not match the type '('msg -> bool) * ('model -> unit) -> (Msg<'msg> -> bool) * (Model<'model> -> unit)' (code 1)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(184,62): (184,74) error FSHARP: Type mismatch. Expecting a
    '('model -> Sub<'msg>) -> Model<'model> -> Sub<Msg<'msg>>'    
but given a
    '('model -> Cmd<'a>) -> Model<'model> -> Cmd<Msg<'a>>'    
The type 'SubId * Subscribe<'msg>' does not match the type 'Effect<'a>' (code 1)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(213,44): (213,52) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(218,44): (218,52) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(223,44): (223,52) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(226,36): (226,44) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(229,36): (229,44) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
./src/Client/fable-output/fable_modules/Fable.Elmish.HMR.5.2.0/hmr.fs(231,28): (231,36) error FSHARP: The value, constructor, namespace or type 'Internal' is not defined. (code 39)
Please provide a succinct description of your issue.
kerams commented 1 year ago

Yes, please! Just ran into this.

pkese commented 1 year ago

Is this only a Fable 4 problem?

I'm seeing this same error also on Fable 3.7.18 - 3.7.20.

What's going on?

et1975 commented 1 year ago

We've been in beta for too long it seems, the elmish package reference allows for pre-releases, new v4 subscriptions haven't been implemented for HMR yet. Try referencing earlier elmish (beta-1) explicitly in your project and consider using lock files to avoid picking unintended upgrades.

pkese commented 1 year ago

@et1975 Thanks. It turned out that "nuget Fable.Elmish.HMR ~> 6.0.0-beta-002" works fine even with Fable 3.7.20.

I just had to avoid running paket install because it upgraded other React & co. packages, which consequently broke HMR.

MangelMaxime commented 1 year ago

Version 6.0.0-beta-003.nupkg has just been released, it should now support the latest alpha of Elmishv 4.

Thanks @kspeakman for his work on it.