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

bundleonly option does not check for errors #1000

Closed
amieres opened this issue Aug 3, 2018 · 3 comments
Closed

bundleonly option does not check for errors #1000

amieres opened this issue Aug 3, 2018 · 3 comments

Comments

@amieres
Copy link

amieres commented Aug 3, 2018

I have been trying out this feature. There are a couple of issues:

1.- Could we add command line options for jsOutput and minJsOutput so that wsconfig.json is not needed?
2.- when project is of type bundleonly wsfcs.exe ignores all errors and generates partial JavaScript code:

        module Hello
            open WebSharper
            [< assembly: JavaScriptExport >]
            do ()
            
            let run() = xxprintfn "Hello"

compiles as

...
...
};
(function()
{
 "use strict";
 var Global,Hello;
 Global=self;
 Hello=Global.Hello=Global.Hello||{};
 Hello.run=function()
 {
  throw 1;
 };
}());

...

When there are more errors it simply compiles as void 0; plus the rest of the supporting code.

When project type is not bundleonly the compiler shows the correct error messages.

3.- Also bundle throws this error:

WebSharper translation: 00:00:00.5186946
WebSharper error FS9001: Global error 'An index satisfying the predicate was not found in the collection.' at    at Microsoft.FSharp.Collections.ListModule.Find[T](FSharpFunc`2 predicate, FSharpList`1 list)
   at WebSharper.Compiler.Bundling.AddExtraBundles(WsConfig config, FSharpList`1 refMetas, Info currentMeta, FSharpList`1 refAssemblies, Compilation comp, FSharpChoice`2 assem)
   at WebSharper.FSharp.Program.Compile$cont@218-3(WsConfig config, Loader loader, FSharpList`1 refs, Task`1 wsRefsMeta, Compilation comp, Info currentMeta, Unit unitVar)
 ...

Which goes away when either netstandard.dll or mscorlib.dll is included as a reference. (accompanied with --noframework)
Maybe the message should say so.

@amieres amieres changed the title buildonly option does not check for errors bundleonly option does not check for errors Aug 3, 2018
@Tarmil Tarmil assigned Tarmil and unassigned Jand42 Aug 6, 2018
@Tarmil
Copy link
Member

Tarmil commented Aug 6, 2018

  1. That would indeed be good, thanks for the suggestion.

  2. Indeed, that is really weird, I'm investigating it.

  3. Interestingly I get a different (but also bad) behavior: the compiler seemingly crashes earlier (after "Waiting on merged metadata: 00:00:00.0039895") without any error message. I'll also investigate this.

@Tarmil
Copy link
Member

Tarmil commented Aug 6, 2018

I just pushed a fix for 2.; this fix also gives me the following output for 3.:

parse error FS0084: Assembly reference 'mscorlib.dll' was not found or is invalid

so I would consider it fixed too.

I issued 1. separately as #1002, since it is a separate concern.

@Tarmil Tarmil closed this as completed Aug 6, 2018
@amieres
Copy link
Author

amieres commented Aug 6, 2018

Excellent!, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants