Minified Script version is error-ing out
Hi, I'm trying to use the minified version of query-builder.standalone.js that I downloaded from http://querybuilder.js.org/ ==> Download button then choose ZIP file. once I start using it I'm getting the below error message on my browser dev console Uncaught TypeError: Cannot set property 'doT' of undefined
but If I use the un-minified version of it, things working fine. can you please advise!
The online documentation is using the minified file without issues. If you want more help, setup a jsfiddle showing the issue.
Did you resolve this issue? I am also finding this, but with both the minified and non-minified versions.
To follow up, this appears to occur in the doT.js portion of the standalone JS file and seems to happen when the doT is minified when refering to global variables. Changing line 177 from _global.doT = doT; to window.doT = doT; did the trick for me.
I cannot alter external dependencies I do not reproduce the issue either.
To follow up, this appears to occur in the doT.js portion of the standalone JS file and seems to happen when the doT is minified when refering to global variables. Changing line 177 from
_global.doT = doT;towindow.doT = doT;did the trick for me.
That may have worked, but my mistake was the order of my script imports. It's quite likely that's what was going on.
Guys this issue is still there in the latest minified standalone version
I started having this problem again and realised that it was because .NET MVC was re-minifying the script, which somehow broke it. I have no problem with the script if it's run as is.
If you're having the same problem you can bundle it in a Bundle instead of a ScriptBundle.
Ok that explains some of the results I see in release build vs no issues in a debug build in .NET MVC
But from here I have no control on how the bundle is minified.
Are you suggesting that I don't include it in a bundle, can you please post a snippet of code on the how to bundle it differently if I have to avoid the redo on minification of the standalone minified lib.
Quoted from your link:
However, if you truly want to show a bundle that is not minified from the bundle route, you’ll need to use “Bundle” and not “ScriptBundle” (or clear the transformations from the ScriptBundle / StyleBundle).
So in MVC, instead of bundling it in a new ScriptBundle bundle it simply in a new Bundle or clear the script bundle transformations (I haven't tried that, but one of the default transformations of a script bundle is apparently minification). E.g:
new ScriptBundle().Transforms.Clear()