breezejs: error when minifying the script - asp.net-mvc-4

I'm facing an issue when minifying breezejs :
Error : Cannot get property « Validator » of a null reference
(that's not the exact message but a translation of the original.)
This is happening when I try to call breeze.Validator, meaning breeze is undefined.
Now, I rely on ASP.NET MVC bundling mechanism for minifying the file breeze.debug.js along with all the other scripts in my application.
However, if instead of using breeze.debug.js I use breeze.min.js (the one provided by Breeze team), then it works fine.
What could be the reason for this problem ?

I've solved the problem by ignoring the breeze.debug.js file when in release mode and by ignoring the breeze.min.js file when in debug mode:
bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
bundles.IgnoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
bundles.Add(new ScriptBundle("~/bundles/breeze").Include("~/scripts/libs/breeze/breeze.debug.js")
.Include("~/scripts/libs/breeze/breeze.min.js"));

Related

Adobe analytics with vue js adding external script

Im struggling to add adobe analytics external scripts to my Vue js project. The client uses Adobe analytics and im battling to add it to the project without the project complaining.
The external adobe script looks like the following:
//assets.adobedtm.com/file.min.js with async
Then it is required that you end it by adding the following just before the closing body tag:
<script type="text/javascript">_satellite.pageBottom();</script>
When the project starts it complains in console that $ is not defined because it is defined in webpack when i start the project and im guessing its not finding the alias.
This is the error:
VM29714:3 Uncaught ReferenceError: $ is not defined
Then further down it complains that it doesnt know what _satellite is:
login:54 Uncaught ReferenceError: _satellite is not defined
I just need the scripts and satellite close to be added to the project, the rest will work once these are added.
Ive tried added the scripts by injecting them into the head tag on runtime but that also doesnt work.
If you are implementing Adobe DTM, you cannot inject the header script dynamically. It must be placed directly on the page without async or deferred attributes.
If you are implementing Adobe Launch, you can inject the header script dynamically and asynchronously. And if you do this, you do not include the footer (_satellite.pageBottom()) code.
Your script example isn't explicit, but the .min portion implies you are using Adobe Launch.
VM29714:3 Uncaught ReferenceError: $ is not defined
This is not directly related to either Adobe DTM or Launch. You may possibly have some other script or code block deployed inside the DTM or Launch interface that references $, but that's a separate issue to work out. Yes, it may be coming from a DTM or Launch script according to the js console, but keep in mind that DTM/Launch is a tag manager. It hosts and deploys other tags/scripts. So you need to do some digging to see which tag/script from which Rule references it. Start by looking at the stack trace to find out where it's coming from.

getting CS1056 Unexpected character '[]' error on .net core 2.0.3 web project

When i build my .net core MVC web project i get this error 190 times :
CS1056 Unexpected character '[]' .
This problem is seen after a few builds. Any suggestions?
This is about a file in my temp folder which is on
users\[My User]\AppData\temp\.NETCoreApp,Version=v2.0.AssemblyAttributes.cs, when I delete this my project completely built.
If you're getting this error during publishing, you can alternatively resolve the issue by creating a new release profile.

Unexpected content from default.ctp on test.php page after fatal error

When I run a test that throws a PHP fatal error, I see my default layout (View/Layouts/default.ctp) in the output, inside CakePHP's core layout for test.php. This only happens when a fatal error occurs. Worse, content about the error is injected into the middle of some of my styled artifacts inside default.ctp, making it hard to read.
If I run a test, especially a test that does not invoke a controller, why should render() ever be called on my default layout for content?
The question is tagged 'cakephp-2.1' but could you be using a Cake core of version 2.2? This version has introduced the new error layout.
You should copy this file from: lib/Cake/View/Layouts/error.ctp to: app/View/Layouts/.
Check the migration guide.

MonoDevelop and AjaxControlToolkit: Register Server Tag in Mono

I know that Mono supports the AjaxControlToolkit but I don't know how to integrate it into MonoDevelop. I added AjaxControlToolkit.dll, System.Web.Extensions.dll and System.Web.Extensions.Design.dll as References in the project but when I build the project I get the warning:
/Users/user1/Projects/FirstProject/Default.aspx(1,1): Warning: Parser failed with error The tag type 'ajaxToolkit:TabContainer' has not been registered.. CodeBehind members for this file will not be added. (FirstProject)
and I when I deploy it I get the error: Unknown server tag 'ajaxToolkit:TabContainer'.
How do I register the server tag in MonoDevelop?
You can use either the <%#Register directive, or add some lines to your Web.config. See here for instructions on either approach.
Using the Web.config mechanism has the advantage that you don't need to add a directive to every page where you want to use the controls.

Team Build sends error when trying to compile a Structuremap method

I'm getting a strange error when trying to compile a solution that is using StructureMap on Team Build.
When I try to compile the solution locally on Visual Studio it works fine, but when trying to queue a new build in Team Build I get the following error:
Overload resolution failed because no accessible 'Use' can be called with these arguments:
The line of code that gets this error is the second one:
ForSingletonOf(Of ISessionFactory)().Use(NHibernateSessionFactory.SessionFactory)
Me.For(Of ISession)().lifecycleIs(New HybridLifecycle()).Use(Function(x) x.GetInstance(Of ISessionFactory)().OpenSession())
It's a standard registration for the NHibernate session, so I don't really get why this error pops up.
Thanks in advance for the clues.
Make sure you have the correct version of NHibernate on the build server, and that your hint paths are all appropriately set in your project file. We haven't had this specific issue (as we're not using NHibernate), but we've had weird issues like that being related to version mismatches of "infrastructure" DLLs between local and build.