fsprojects / FsReveal

FsReveal parses markdown and F# script file and generates reveal.js slides.
http://fsprojects.github.io/FsReveal
258 stars 101 forks source link

running paket install or paket update breaks FSReveal with FsiEvaluationException #106

Open s952163 opened 7 years ago

s952163 commented 7 years ago

running paket install or paket update breaks FSReveal:

  1. git clone FSReveal
  2. run build.cmd slides are processed without an error
  3. run paket update it will download the various .NET core libraries
  4. running build.cmd will show the following output:

FsiEvaluationException:

Error:

    build.fsx(96,32): error FS0001: This expression was expected to have type
        ByteSegment
    but here has type
        byte []

Output: [Loading C:\Users\user\Documents\Source\FsReveal\packages\FSharp.Formatting\FSharp.Formatting.fsx Loading C:\Users\user\Documents\Source\FsReveal\packages\FsReveal\fsreveal\fsreveal.fsx Loading C:\Users\user\Documents\Source\FsReveal\build.fsx]

Input: C:\Users\user\Documents\Source\FsReveal\build.fsx \Arguments: C:\fsi.exe

Exception: Yaaf.FSharp.Scripting.FsiEvaluationException: Error while compiling or executing fsharp snippet. ---> System.Exception: Operation failed. The error text has been print the error stream. To return the corresponding FSharpErrorInfo use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.commitResult[a,b](FSharpChoice2 res) at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.EvalScript(String filePath) at Yaaf.FSharp.Scripting.Helper.evalScript@1303.Invoke(String arg00) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1303 at Yaaf.FSharp.Scripting.Helper.save_@1276-2.Invoke(Unit unitVar0) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1277 at Yaaf.FSharp.Scripting.Helper.consoleCapture[a](TextWriter out, TextWriter err, FSharpFunc2 f) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1221 at Yaaf.FSharp.Scripting.Helper.redirectOut@1247[a](Boolean preventStdOut, OutStreamHelper out, OutStreamHelper err, FSharpFunc2 f) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1254 at Yaaf.FSharp.Scripting.Helper.save_@1275-1.Invoke(String text) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1276 --- End of inner exception stack trace --- at Yaaf.FSharp.Scripting.Helper.save_@1275-1.Invoke(String text) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1284 at Yaaf.FSharp.Scripting.Helper.session@1306.Yaaf-FSharp-Scripting-IFsiSession-EvalScriptWithOutput(String ) in C:\code\fake\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1308 at Fake.FSIHelper.runScriptUncached(Boolean useCache, String scriptPath, IEnumerable1 fsiOptions, Boolean printDetails, CacheInfo cacheInfo, TextWriter out, TextWriter err) in C:\code\fake\src\app\FakeLib\FSIHelper.fs:line 471 build.fsx(96,32): error FS0001: This expression was expected to have type ByteSegment but here has type byte []

On Win7 with VS2015 On Win10 with VS2015 and VS2017

Workaround: do not run paket install or update

drk-mtr commented 5 years ago

The first error can be worked around fairly easily, by replacing ASCII.bytes "refreshed" with ASCII.bytes "refreshed" |> ByteSegment in build.fsx.

However after updating build.fsx to use the modern FAKE libraries, I start hitting problems - I'm guessing due to older FSharp.Literate or FSharp.Formatting etc. versions. Currently stuck on this:

System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Formatting-Common>.$YaafFSharpScripting' threw an exception. ---> System.TypeLoadException: Could not load type 'FSharp.Compiler.SourceCodeServices.FSharpChecker' from assembly 'FSharp.Compiler.Service, Version=25.0.1.0, Culture=neutral, PublicKeyToken=null'.
   at <StartupCode$FSharp-Formatting-Common>.$YaafFSharpScripting..cctor()
   --- End of inner exception stack trace ---
   at Yaaf.FSharp.Scripting.Env.get_isMono()
   at Yaaf.FSharp.Scripting.FsiOptions.get_Default()
   at <StartupCode$FSharp-Literate>.$Evaluator.fsiOptions@103.Invoke(Unit _arg1)
   at FSharp.Literate.FsiEvaluator..ctor(FSharpOption`1 options, FSharpOption`1 fsiObj)
   at <StartupCode$FSI_0005>.$FSI_0005_Build$fsx.main@() in D:\Coding\WhatTheFSharp\FsReveal\build.fsx:line 50
Stopped due to error