This project is read-only.

Intermittent Noesis.Javascript.JavascriptException in Windows Server 2012 x64

Dec 11, 2014 at 6:16 PM
I am getting really strange errors when using MSBuild on my build servers. (Truncated for clarity)
src\packages\JSLintNet.MSBuild.1.6.5\build\JSLintNet.MSBuild.targets(20,5): error MSB4018: The "JSLintTask" task failed unexpectedly. src\packages\JSLintNet.MSBuild.1.6.5\build\JSLintNet.MSBuild.targets(20,5): error MSB4018: Noesis.Javascript.JavascriptException 
error MSB4018:    at Noesis.Javascript.CompileScript(Local<v8::Script>* , Char* source_code, Char* resource_name) 
error MSB4018:    at Noesis.Javascript.JavascriptContext.Run(String iSourceCode)
error MSB4018:    at JSLintNet.JSLintFactory.CreateContext() 
error MSB4018:    at JSLintNet.JSLintTask.Execute()
error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
The command used to run the build was
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /t:JSLintNet MyProject.csproj
The error happens seemingly randomly. I ran the same command in quick succession, and I have failures 50% of the time.

As a side note, running JSLintNet.Console.exe works 100% of the time.
packages\JSLintNet.MSBuild.1.6.5\tools\JSLintNet.Console.exe MyProject
It also works 100% of the time on developer machines I have tested (Windows 7 64-bit, same MSBuild version)

More details about my build environment:
  • Windows Server 2012 64-bit
  • MSBuild: 4.0.30319
  • .NET Framework: 4.5
Anybody has any ideas on what could be the cause? If V8 is the issue, is there a beta version using Chakra that I could try? The beta NuGet package seems to be delisted.
Dec 14, 2014 at 8:23 PM
Thanks for the thorough report. It helps a lot.

This is related to this discussion:
https://jslintnet.codeplex.com/discussions/544991

And this issue:
https://jslintnet.codeplex.com/workitem/39

There seems to be something unique about the MSBuild execution context that causes intermittent issues on certain environments. I have considered switching to other JavaScript engines to avoid the issue, but unfortunately they all have a noticeable negative performance trade-off.

I believe the next best step is for us to make a custom build of the latest Noesis JavaScript.NET source and see if that improves things.
Dec 16, 2014 at 10:41 AM
I'm also experimenting with switching from Noesis.JavaScript to ClearScript (Microsoft's V8 wrapper). So far it doesn't exhibit any intermittent failures, but I'll queue up a bunch more builds to be sure.

If all goes well, this change will be released as 1.7.
Dec 19, 2014 at 8:34 AM
Dec 29, 2014 at 7:19 PM
That's great news! As a workaround, I am running the JSLint executable as one of the AfterBuild tasks in my project.

Thanks Qube for your hard work in making JSLint easily accessible for .NET developers! I look forward to your next version.
Dec 30, 2014 at 8:22 PM
You're welcome. JSLint.NET for MSBuild 1.7 is up on NuGet, so please upgrade and let me know how you go.
Jan 13, 2015 at 4:37 PM
The new version works perfectly now. I have been running version 1.7 for more than a week now, and the intermittent errors are gone. Seems like the switch from Noesis did the trick.

A minor issue is that the option to run JSLint on save does not seem to work anyone. Using VS 2013 Ultimate.
Jan 16, 2015 at 11:18 PM
Edited Jan 16, 2015 at 11:20 PM
prokaryx wrote:
A minor issue is that the option to run JSLint on save does not seem to work anyone. Using VS 2013 Ultimate.
Well that's odd. The "run on save" setting is only available with the Visual Studio extension - see the settings table. Have both the NuGet and VSIX been upgraded?
Jan 20, 2015 at 6:49 PM
Doh! I just bumped the NuGet version number but forgot to upgrade the VSIX. Everything works fine now.