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

.fsi expected in wrong folder #1919

Closed
krauthaufen opened this issue Oct 1, 2019 · 3 comments
Closed

.fsi expected in wrong folder #1919

krauthaufen opened this issue Oct 1, 2019 · 3 comments

Comments

@krauthaufen
Copy link
Collaborator

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
@krauthaufen krauthaufen changed the title .fsi search in wrong folder .fsi searched in wrong folder Oct 2, 2019
@krauthaufen krauthaufen changed the title .fsi searched in wrong folder .fsi expected in wrong folder Oct 2, 2019
krauthaufen added a commit to fsprojects/FSharp.Data.Adaptive that referenced this issue Oct 2, 2019
@krauthaufen
Copy link
Collaborator Author

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

@alfonsogarciacaro
Copy link
Member

alfonsogarciacaro commented Oct 4, 2019

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!

@krauthaufen
Copy link
Collaborator Author

works!!!
thank you lots 😀

krauthaufen added a commit to fsprojects/FSharp.Data.Adaptive that referenced this issue Oct 4, 2019
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