Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions 3.5.0 & 3.6.0 fail to compile #37

Closed
Dzoukr opened this issue Oct 22, 2019 · 5 comments
Closed

Versions 3.5.0 & 3.6.0 fail to compile #37

Dzoukr opened this issue Oct 22, 2019 · 5 comments

Comments

@Dzoukr
Copy link

Dzoukr commented Oct 22, 2019

Hello friend,

I found strange behavior:

  1. I created fresh new SafeStack app with Fable.Remoting
  2. I got the latest dependencies using paket update (nothing changed in paket.dependencies though)
  3. Fable.SimpleJson package got to the latest 3.6.0 version
  4. fake build -t run fails on Fable.SimpleJson package with this error:
ERROR in ./.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/provaznik/OneDrive/Talks/DotNetDays 2019/newsafestack/.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs(128,23): (128,65) error FABLE: Cannot resolve System.Enum.IsDefined
 @ ./.fable/Fable.Remoting.Client.5.8.0/Proxy.fs 8:0-289 159:116-214 192:51-83
 @ ./.fable/Fable.Remoting.Client.5.8.0/Remoting.fs
 @ ./src/Client/Client.fs
 @ ./src/Client/Client.fsproj
 @ multi ./src/Client/Client.fsproj

ERROR in ./.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/provaznik/OneDrive/Talks/DotNetDays 2019/newsafestack/.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs(136,23): (136,65) error FABLE: Cannot resolve System.Enum.IsDefined
 @ ./.fable/Fable.Remoting.Client.5.8.0/Proxy.fs 8:0-289 159:116-214 192:51-83
 @ ./.fable/Fable.Remoting.Client.5.8.0/Remoting.fs
 @ ./src/Client/Client.fs
 @ ./src/Client/Client.fsproj
 @ multi ./src/Client/Client.fsproj

ERROR in ./.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/provaznik/OneDrive/Talks/DotNetDays 2019/newsafestack/.fable/Fable.SimpleJson.3.5.0/Json.Converter.fs(145,15): (145,51) error FABLE: Cannot resolve System.Enum.IsDefined
 @ ./.fable/Fable.Remoting.Client.5.8.0/Proxy.fs 8:0-289 159:116-214 192:51-83
 @ ./.fable/Fable.Remoting.Client.5.8.0/Remoting.fs
 @ ./src/Client/Client.fs
 @ ./src/Client/Client.fsproj
 @ multi ./src/Client/Client.fsproj

ERROR in ./.fable/Fable.SimpleJson.3.5.0/TypeInfo.Converter.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/provaznik/OneDrive/Talks/DotNetDays 2019/newsafestack/.fable/Fable.SimpleJson.3.5.0/TypeInfo.Converter.fs(132,11): (132,19) error FABLE: Cannot resolve System.Type.get_IsEnum
 @ ./.fable/Fable.Remoting.Client.5.8.0/Remoting.fs 16:0-81 48:19-33
 @ ./src/Client/Client.fs
 @ ./src/Client/Client.fsproj
 @ multi ./src/Client/Client.fsproj

ERROR in ./.fable/Fable.SimpleJson.3.5.0/TypeInfo.Converter.fs
Module Error (from ./node_modules/fable-loader/index.js):
C:/Users/provaznik/OneDrive/Talks/DotNetDays 2019/newsafestack/.fable/Fable.SimpleJson.3.5.0/TypeInfo.Converter.fs(133,13): (133,38) error FABLE: Cannot resolve System.Enum.GetUnderlyingType
 @ ./.fable/Fable.Remoting.Client.5.8.0/Remoting.fs 16:0-81 48:19-33
 @ ./src/Client/Client.fs
 @ ./src/Client/Client.fsproj
 @ multi ./src/Client/Client.fsproj

Same happens for 3.5.0, BUT... version 3.4.0 works!

I hope it will give you some hint. :) 🙏

@Zaid-Ajaj
Copy link
Owner

Hello Roman, my gut feeling tells me that you have to update fable-compiler to latest version as well because version 2.4.5 introduced proper Enum reflection functions which are used in SimpleJson 3.5.0 and later which is why earlier versions of Fable (currently 2.3.3 in SAFE) will break because they cannot yet compile these Enum reflection functions (what is shown in the error messages)

@Dzoukr
Copy link
Author

Dzoukr commented Oct 22, 2019

Yes, you are right. I had to manually upgrade also package.json file - Fable compiler was out of date.

Speaking about this... I tried Femto, but it didn't find I am having old version of fable-compiler... Is it something that Femto should handle, or Fable itself is expection and I need to keep it up-to-date with other libraries manually?

@Dzoukr Dzoukr closed this as completed Oct 22, 2019
@Zaid-Ajaj
Copy link
Owner

Speaking about this... I tried Femto, but it didn't find I am having old version of fable-compiler... Is it something that Femto should handle, or Fable itself is expection and I need to keep it up-to-date with other libraries manually?

Femto could handle this edge case if I had added the npm metadata to this package but it seemed very overkill considering that fable-compiler is almost always expected to be latest. This happened only because I updated SimpleJson to match with latest Fable functionality before SAFE updated the template in SAFE-template#318

But again for a library like SimpleJson that depends on specific Fable compiler features maybe it would make sense to add fable-compiler to the npm metadata.

I discussed this with @MangelMaxime in this comment be he wasn't very fond of the idea at that time.

@Dzoukr
Copy link
Author

Dzoukr commented Oct 22, 2019

Anyway, thanks a lot for help, man! 🙏

@psfinaki
Copy link

This saved me from despair, also forgot to update the fable-compiler. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants