Module build failed (from ./node_modules/fable-loader/index.js): Error: File src/App.fs cannot be found in source list
See original GitHub issueDescription
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:
yarn install
paket install
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
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Type errors sometimes lead to "File not found in source list ...
Description I got an error saying roughly ERROR in ./src/Components/Plot.fs Module build failed (from ./node_modules/fable-loader/index.js): ...
Read more >Module not found: Error: Can't resolve 'fs' error - solved
js Module not found : Error: Can't resolve 'fs' in 'C:\Source\nien\vital10-frontend\node_modules\tslint\lib' i 「wdm」: Failed to compile.
Read more >Module not found: Can't resolve 'fs' error [Solved]
The error Module not found: Error: Can't resolve 'fs' occurs because there has been a breaking change in Webpack version 5.
Read more >Open App - YouTube
Module build failed (from ./node_modules/ source -map-loader/dist/cjs. js ): Error : ENOENT: no such file or directory, ...
Read more >Node library requires lib unavailable for a web use
When upgrading to latest Angular, I can't build anymore. ERROR in ./node_modules/readline/readline.js Module not found: Error: Can't resolve 'fs ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
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 momentmap
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.Thanks for the repro. I’ll try to find out what’s wrong.