slogsdon / parcel-plugin-fable

Parcel asset type plugin for Fable
https://www.npmjs.com/package/parcel-plugin-fable
MIT License
21 stars 4 forks source link

Issue when building with cache and NuGet dependencies #10

Open slogsdon opened 6 years ago

slogsdon commented 6 years ago

When building a project with cache present and NuGet dependencies, some modules (internal and external) throw errors during compilation:

🚨  /Users/shane.logsdon/.nuget/packages/fable.elmish/1.0.1/fable/program.fs: Cannot resolve dependency './cmd.fs' at '/Users/shane.logsdon/.nuget/packages/fable.elmish/1.0.1/fable/cmd.fs'
    at /Users/shane.logsdon/Code/javascript/fable-browser-notes/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
    at load (/Users/shane.logsdon/Code/javascript/fable-browser-notes/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/Users/shane.logsdon/Code/javascript/fable-browser-notes/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /Users/shane.logsdon/Code/javascript/fable-browser-notes/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:166:21)
Condition always false [0:8,6]
Dropping unreachable code [0:16,4]
Dropping side-effect-free statement [0:24,4]
Condition always true [0:28,4]
Dropping unreachable code [0:34,2]
ERROR: /Users/shane.logsdon/Code/javascript/fable-browser-notes/src/Counter/Types.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@232-6.Invoke(Tuple`2 _arg1)
ERROR: /Users/shane.logsdon/Code/javascript/fable-browser-notes/src/Home/Types.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@232-6.Invoke(Tuple`2 _arg1)
ERROR: /Users/shane.logsdon/Code/javascript/fable-browser-notes/src/Counter/State.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@232-6.Invoke(Tuple`2 _arg1)
ERROR: /Users/shane.logsdon/Code/javascript/fable-browser-notes/src/Home/State.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@232-6.Invoke(Tuple`2 _arg1)
ERROR: /Users/shane.logsdon/.nuget/packages/fable.elmish/1.0.1/fable/cmd.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@232-6.Invoke(Tuple`2 _arg1)
slogsdon commented 6 years ago

~To make things more interesting, this happens when attempting to convert the Elmish React template output from webpack to parcel, but does not happen when adding new packages to this project's included example.~

Edit: this ended up being incorrect. Adding Fable.React only did not cause the issue, but once Fable.Elmish and Fable.Elmish.React were added, the issue returned:

ERROR: /Users/shane.logsdon/.nuget/packages/fable.elmish/1.0.1/fable/program.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
🚨  src/../../../../../.nuget/packages/fable.elmish/1.0.1/fable/program.fs: /Users/shane.logsdon/.nuget/packages/fable.elmish/1.0.1/fable/program.fs doesn't belong to any of loaded pr
ERROR: /Users/shane.logsdon/.nuget/packages/fable.elmish.react/1.0.0/fable/react.fs doesn't belong to any of loaded projects []
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
   at Fable.CLI.StateUtil.loop@228-6.Invoke(Tuple`2 _arg1)