Fable: .fsi expected in wrong folder

Created on 1 Oct 2019  路  3Comments  路  Source: fable-compiler/Fable

Description

When compiling a project including .fsi files something with paths seems to get messed up.
My current project includes .fsi files in a folder-structure. So the real path of the file would be something like C:\dev\fsharp-data-adaptive\src\FSharp.Data.Adaptive\Datastructures\Index.fsi but fable keeps looking for it in C:\dev\fsharp-data-adaptive\Datastructures\Index.fsi and complains that the file doesn't exist.

Repro code

Create a repo with .fsi files in a project-folder or clone https://github.com/fsprojects/FSharp.Data.Adaptive and remove the $(MSBuildThisFileDirectory) from FSharp.Data.Adaptive.fsproj

when using FSharp.Data.Adaptive simply start a webpack-dev-server and the error looks like this:

ERROR in ../Demo/Fable/Fable.fsproj
Module build failed (from C:/dev/fsharp-data-adaptive/node_modules/fable-loader/index.js):
Error: Could not find a part of the path 'C:\dev\fsharp-data-adaptive\Datastructures\Index.fsi'.
    at Loader.command.then.data (C:\dev\fsharp-data-adaptive\node_modules\fable-loader\index.js:98:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Workaround

I can add <Compile Include="$(MSBuildThisFileDirectory)Datastructures\Index.fsi" /> and everything works nice, but this sadly doesn't work when packaging the project as nupkg (with fable-folder included)

Expected and actual results

expected: paths should be correct 馃榾
actual: they aren't

Related information

  • Fable version: 2.4.3
  • Windows 10

Most helpful comment

works!!!
thank you lots 馃榾

All 3 comments

the problem can be avoided by setting changing the current-directory to the project folder...

Thanks for the detailed report @krauthaufen! This made it much easier to spot the problem. I've just published fable-compiler 2.4.4 with a fix, could you please try it? Cheers!

works!!!
thank you lots 馃榾

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MangelMaxime picture MangelMaxime  路  3Comments

stkb picture stkb  路  3Comments

forki picture forki  路  3Comments

nozzlegear picture nozzlegear  路  3Comments

MangelMaxime picture MangelMaxime  路  3Comments