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

Compilation fails on an FsCheck based project #3813

Closed
lazywithclass opened this issue Apr 30, 2024 · 2 comments
Closed

Compilation fails on an FsCheck based project #3813

lazywithclass opened this issue Apr 30, 2024 · 2 comments

Comments

@lazywithclass
Copy link

lazywithclass commented Apr 30, 2024

Description

I am trying to convert a project I've written from F# to JS.
The project uses FsCheck, but I am not sure how to configure Fable in a way that it compiles also the dependencies (in this case FsCheck), or if that's needed at all.

Repro code

The project is this https://github.com/jessi-bit/Ombra/
I've followed along this tutorial https://fable.io/docs/getting-started/your-first-fable-project.html

Expected and actual results

After I execute dotnet fable I get the following

Parsing interpreter.fsproj...
.> dotnet restore interpreter.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_JAVASCRIPT=true
  Determining projects to restore...
  Restored /home/nixos/workspace/Ombra/interpreter/interpreter.fable-temp.csproj (in 345 ms).
.> dotnet restore /home/nixos/workspace/Ombra/interpreter/interpreter.fsproj
  Determining projects to restore...
  Restored /home/nixos/workspace/Ombra/interpreter/interpreter.fsproj (in 225 ms).
Project and references (4 source files) parsed in 3422ms

Started Fable compilation...
Compiled 4/4: interpreters-verification-of-equality.fsx
Fable compilation finished in 1607ms

./interpreter-closures-semantics.fsx(20,19): (20,36) warning FSHARP: Incomplete pattern matches on this expression. For example, the value 'Boo (_)' may indicate a cas
e not covered by the pattern(s). (code 25)
./interpreters-verification-of-equality.fsx(1,1): error FABLE: Cannot find FsCheck.Config constructor
Compilation failed

Other files in the project are compiled, but I am not understanding this error message (I am not a C# or F# developer, I just created this project for a bit of research on a uni subject).

Related information

  • Fable version: 4.17.0
  • Operating system: NixOS

Any help or pointer would be greatly appreciated, sorry if I've missed some crucial step in the docs.

@MangelMaxime
Copy link
Member

Hello @lazywithclass,

In order for fable to consume a package as a library that package needs to have the F# sources files packed under a fable folder. See Author a Fable library for more information on that.

So it is possible that FsCheck is not compatible with Fable and would first need to be made compatible if possible. Note that Fable does not support all the .NET BCL APIs so note all F# packages can be consumed from Fable out of the box.

@lazywithclass
Copy link
Author

I see, thanks for the help @MangelMaxime, I will have a look at the link

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

2 participants