Gojs throw js error in production env

I use gojs work with .net MVC, it’s work well in develop env. , but when I publish my project to production env, gojs throw an js error, and I’m not sure how to solve it.

And I searched for this error, maybe it’s env issue? windows 2008 + sqlserver 2008 + .net 4.0

ERROR:
Message: Can’t have ‘break’ outside of loop: break a
Error code: JS1019
Severity: 0
Subcategory: run-time
File: /Content/gojs/js/go.js
Start line: 1342
Start column: 112
End line: 1342
End column: 119
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: BundleTransformer.MicrosoftAjax.MicrosoftAjaxParsingException: Message: Can’t have ‘break’ outside of loop: break a
Error code: JS1019
Severity: 0
Subcategory: run-time
File: /Content/gojs/js/go.js
Start line: 1342
Start column: 112
End line: 1342
End column: 119

Try using go-debug.js instead of go.js, and see if there are any console messages. Do this both in your development environment as well as when deployed.

Precisely which version of GoJS are you using?

I tried go-debug.js (newest version), it throw the same error, and everthing is ok in my development env, my development evn is windows 10, production env is windows server 2008. Now I think it’s the js support problem, gojs throw the error at some code like ‘break a;’ without switch/case, see below document, maybe it’s not about gojs support? But I’m confuse how to slove this issue now.

break Statement
Terminates the current loop, or if in conjunction with a label, terminates the associated statement.
break [label];

I searched our sources and there is no use of break with the optional label.

But there are uses of break with the optional label in the go.js and go-debug.js files. They must have been introduced by Google’s Closure Compiler as part of the minification process.

So you need to find out exactly which JavaScript interpreter is running on your Windows Server 2008 system. GoJS requires an HTML5 environment with an EcmaScript 5 interpreter.

Maybe a better question is: why you are running the client software (of which GoJS is a piece) on Windows Server 2008 without using an HTML5-compatible browser? Only the server part of your app should be running on the server.

Hi Walter, May be I’m not clear myself. Of course, I deploy the project to production server, and also use chrome/IE to open it with my own computer on windows 10/7, but all the browser show the same error. What I said is js throw the error both on server browser or client browser .

I solve this, the go.js file is already a minified file.

I’m glad you figured it out. Are you saying that minifying the already minified GoJS library caused an error? That sounds like a bug in the minifier that you are using.

Yes, I need change the js file name manually, and thank for your great help.