Shmew / Feliz.Plotly

Fable bindings written in the Feliz-style for plotly.js.
https://shmew.github.io/Feliz.Plotly/
MIT License
54 stars 13 forks source link

Feliz.Plotly missing files #15

Closed MaxWilson closed 4 years ago

MaxWilson commented 4 years ago

Description

Adding a reference to Feliz.Plotly causes my project to fail to compile.

Steps to reproduce

  1. Make a new project by cloning the elmish-getting-started template.
  2. Update Feliz dependencies to latest version.
  3. Use femto to add reference to Feliz.Plotly.
  4. Add ifly-loader dependency to webpack config.
  5. npm start.
  6. See error:
ERROR in ./src/Saves.fsproj
Module build failed (from ./node_modules/fable-loader/index.js):
Error: File does not exist: C:/code/saves/.fable/Feliz.Plotly.1.0.1/Props/*.fs
    at C:\code\saves\node_modules\fable-loader\index.js:98:22
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Pre-packaged repro is here. Run npm i and then npm start.

Expected behavior

No error, should still show the elmish-getting-started app (since I haven't yet added any code that actually uses Feliz.Plotly).

Additional context

dir "C:\code\saves\.fable\Feliz.Plotly.1.0.1\Props\*.fs"

*snip*

05/20/2020  10:39 AM             1,293 Uniformtext.fs
05/20/2020  10:39 AM               492 Unselected.fs
05/20/2020  10:39 AM               644 Up.fs
05/20/2020  10:39 AM             5,586 Updatemenu.fs
05/20/2020  10:39 AM               370 Updatemenus.fs
05/20/2020  10:39 AM            67,686 Violin.fs
05/20/2020  10:39 AM            70,837 Volume.fs
05/20/2020  10:39 AM            67,737 Waterfall.fs
05/20/2020  10:39 AM            12,325 X.fs
05/20/2020  10:39 AM            82,934 Xaxis.fs
05/20/2020  10:39 AM            21,139 Xbins.fs
05/20/2020  10:39 AM            12,325 Y.fs
05/20/2020  10:39 AM            82,882 Yaxis.fs
05/20/2020  10:39 AM            21,139 Ybins.fs
05/20/2020  10:39 AM            12,325 Z.fs
05/20/2020  10:39 AM            68,016 Zaxis.fs

I don't know why fable-loader is saying nothing is there.

Known workaround

Use Feliz.Plotly 0.22.0 instead of 1.0.x.

Shmew commented 4 years ago

Hi @MaxWilson, you scared me! I thought it was because I used a backslash in my path instead of a / for the property directory. Turns out both work.

This happened because the PR I did to add globbing support for the fable compiler was after the current version you have installed, and I didn't get around to updating the package with it until 1.0.

Changing these lines:

"fable-compiler": "^2.4.16",
"fable-loader": "^2.1.8",

to this:

"fable-compiler": "^2",
"fable-loader": "^2",

and doing a npm upgrade allowed the build to succeed and show the graph.

MaxWilson commented 4 years ago

(Aside: I'm not sure what you mean about backslashes. In the context of dir on windows, forward slash doesn't work with wildcards, only backslash does. Forward slash only works with exact file paths, so 'dir C:/code/saves/.fable/Feliz.Plotly.1.0.1/Props/*.fs' fails.)

Thank you, now I understand the error, and the fix you suggested works for me. Closing the issue.

Shmew commented 4 years ago

The paths in the .fsproj are parsed by the fable compiler to determine what files to look for, I jumped to conclusions that it was because of a backslash instead of forward slash as a potential reason because I knew the feature worked.

Anyways, glad you were able to get it resolved! :)