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

Module build failed (from ./node_modules/fable-loader/index.js): Error: File src/App.fs cannot be found in source list #243

Closed
entyo opened this issue Jan 17, 2020 · 5 comments

Comments

@entyo
Copy link

entyo commented Jan 17, 2020

Description

Checking Release Notes, I noticed that Fable support of FSharpPlus has been enhanced in recent versions. So I tried to use 1.1.0-RC1 in fable-loader project.

I just wrote some code in src/App.fs:

module App

open Fable.Core.JS
open FSharpPlus

let res1 = map ((+) 2) (Some 2)

console.log "hello"

But when I try to transpile, I got the error in the title.

ERROR in ./src/App.fs
Module build failed (from ./node_modules/fable-loader/index.js):
Error: File /home/e_ntyo/fable-fsharpplus-sample/src/App.fs cannot be found in source list:
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Internals.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Extensions.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Converter.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Numeric.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Monoid.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Functor.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Foldable.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Bifoldable.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Traversable.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Indexable.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/MonadTrans.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Collection.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Tuple.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Operators.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Builders.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Identity.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/List.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Seq.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Option.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Error.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Cont.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Reader.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Writer.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/State.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Monoids.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Lens.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/NonEmptyList.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/ZipList.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/ParallelArray.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/DList.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Validations.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Kleisli.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Free.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Coproduct.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Memoization.fs
/home/e_ntyo/fable-fsharpplus-sample/.fable/FSharpPlus.1.1.0-RC1/Parsing.fs (/home/e_ntyo/fable-fsharpplus-sample/src/App.fs)
    at Loader.command.then.data (/home/e_ntyo/fable-fsharpplus-sample/node_modules/fable-loader/index.js:98:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 @ ./src/App.fsproj 1:0-25 1:0-25

The exception seems to be thrown in transformFile function in FSharp2Fable.fs, which is a part of fable-loader.

Repro steps

I created a sample project for repro at here.

3 STEPS TO RUN:

  1. yarn install
  2. paket install
  3. yarn start

Expected behavior

App.fs should be transpiled successfully.

Actual behavior

I got Error: File /home/e_ntyo/fable-fsharpplus-sample/src/App.fs cannot be found in source list: and transpilation failed.

Related information

My runtime environment:

  • .NET Core 3.1
  • Paket 5.241.6
@gusty
Copy link
Member

gusty commented Jan 17, 2020

Thanks for the repro. I'll try to find out what's wrong.

@wallymathieu
Copy link
Member

Seems like you can use Map.Invoke as a workaround for the issue.

@entyo
Copy link
Author

entyo commented Jan 18, 2020

@wallymathieu Thank you! I checked this commit 41fb254

@wallymathieu
Copy link
Member

This sounds related: fable-compiler/Fable#1940

@gusty
Copy link
Member

gusty commented Mar 5, 2020

OK, now I think we can explain a bit this issue.

  • Fable compilation was broken and the tests we had at the moment of this issue were not checking the full compilation.

  • I think there might be a bug in the Fable side that when certain errors are present on the source files it breaks something internally in the compiler and it reports as the file (with the error) is missing. ( cc @alfonsogarciacaro ). I encountered that situation all the time while fixing the fable conditionals.

  • At the moment of writing this, Fable doesn't seem to support complex trait calls likes the one used by the map function, so for the moment map is not supported in Fable. We might add partial support soon so it will become usable to some extent.

  • I suggest you try the recently released v1.1.0-RC3 which has proper testing, although map is not supported, but >>= is (see the release notes). Feedback is more than welcome and feel free to re-open if the problem persist.

@gusty gusty closed this as completed Mar 5, 2020
MaxWilson added a commit to MaxWilson/Simple-SavingThrowGraphsFor5E that referenced this issue Mar 2, 2024
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