Error when calling createDefaultLayers() in HERE API - here-api

EDIT: Is there anywhere to get an un-minified version of the Here-api to use when debugging? It's impossible for me to figure out what 'v' is and why it may be undefined.
We're using the HERE API both from our website where it works flawlessly and our old RDP C++ application which runs a similar webpage in an embedded IE window. It should be using a stripped version of IE11 I believe.
We recently upgraded to the new HERE API after routing stopped working in the old one, and it worked for a while but a while ago it suddenly didn't. And no one can recall making any changes that could affect this.
I have narrowed it down to a single line of code where it crashes. (platform is already defined in the scope through our geo-service script, the same one being used for the web that works)
var defaultLayers = platform.createDefaultLayers();
This is an initialization of the map layers that is required for the maps to work, but we simply can't perform this action through this embedded browser window even though we run almost identical code on the web.
We receive two error messages of:
'v' is undefined
With a reference to some dynamically generated eval code.
This is the only lead I've managed to dig up, it's not much but I'm hoping someone else has encountered a similar issue and can point me in the right direction what to look for.

I found the issue, it was totally self inflicted...
When we implemented the solution there was an issue in the core js file from Here which made it not work in our servers due to some path being wrong. To fix this we had changed the path so it worked and then hosted our own version of the core file.
This worked great, until Here put up a new minor release which is automatically distributed through the same content link as before. This meant the minified files were no longer in sync with the variable names, thus causing v to never be defined where it should, since in our file it was probably named something else.
It was only by chance I noticed that the core js was side-loaded like that, I was looking in the completely opposite direction the entire time and didn't even consider the loading might've been tinkered with.

Related

SignalR $.connection not defined, intermittent successful definition on some PCs

I have a MVC5 project using signalr to perform updates to a list. Inside script.js, there is a variable link to defined as var link = $.connection.hub. There is also a bundleconfig file to load the dependent scripts, signalr/jquery and jquery in the proper order of course.
The script /signalr/hubs is loaded in from the html manually.
bundles.Add(new ScriptBundle("~/bundles/signalr").Include(
"~/Scripts/script.js",
"~/Scripts/jquery.signalR-2.0.2.min.js"));
When the VS 2013 Web project is run, it works fine until the project is copied over to another PC that it does not work as intended. The variable link is undefined as $.connection is undefined too ($ is defined though).
I presume that jquery.signalR-2.0.2.min.js is not read or executed at all.
Questions:
Might this have anything to do with the environment of the PCs? (Windows 7 is OK, Windows 8 is not OK)
What could prevent jquery.signalR-2.0.2.min.js from running?
Does creating a new View/Controller play a part in the error (creating a view, using a layout page)?
Please see similar question: SignalR and MVC bundle as it shows how to add SignalR into an MVC bundle. I think their answer should help solve your problem.
I would comment instead of answer, but I don't have enough reputation.

Angular.js $response async update of $scope variable

This is my first attempt at working with Angular.js after using Backbone.js for some projects. I used Yeoman to get the initial angular scaffolding setup as well as to manage various dependencies etc.
The first issue I've run into is with the angular $resource service I setup to hit an external API which returns a simple array of names. In using the Chrome web inspector I see that the data is returned as expected but never renders. I suspect this is due to the call by asynchronous and when the page renders there is no data to show. Shortly after the page renders the data is returned from the API but the page never re-renders again.
The Angular docs state pretty clearly in the tutorial that this should happen automagically via the angular data binding but so far it's never worked for me.
I put the code I'm experimenting with now up in a repo on GitHub at https://github.com/chad-skidmore/angular-test
I've not found any documented issues so far regarding this issue after spending the last couple days hacking around to try and get it to work. If I pass an array to the controller it works fine of course which is one reason I think that there is something hosed in the data binding for async external resource calls.
Any pointers or help would be appreciated.
You can also get to the same code on plnkr: http://plnkr.co/edit/BAHhsT2l1HKnpjiKLZMK
Thanks,
chad

Asynchronous Javascript loading different behaviour

I am developing a widget, and am using extJS framework (along with stomp,orbited servers). It requires 5 different Javascript files. To avoid impacting load time for users, I am trying to load them asynchronously.
Through some callback stacks, I have managed to asynchronously load them in order they are required.
However, the widget does not work at all in the asynchronous case. I then copied the "modified" resultant HTML DOM from Chrome's developer tools, and created a static HTML file.
The static file works. I am printing few alerts when different JS files are loaded in both cases. The order of these alerts is the same.
How do I detect and fix the error. Stumped after lot of debugging.
(Link removed as they were on production server. Managed to detect the issue and find a workaround - please see answer below - keeping for anyone's reference).
The problem is that Ext.onReady is called as soon as document is ready, which is BEFORE any other scripts are loaded asynchronously.
Thus, the initialization code was not getting called. I manage to work it around by calling Ext.each("dummy args", initialization_function, this) in the last javascript that is loaded. This made things work for me.

Cannot customize sfGuardGroup - cached version autosfGuardGroup is always used

I'm using the sfGuardPlugin with Propel on Symfony 1.4.11. I'm overriding some templates in sfGuardUser as well as sfGuardGroup and sfGuardPermission. On my localhost version this works, but on shared hosting the sfGuardGroup and sfGuardPermission modules stubbornly ignore the templates in my app, reverting instead to the cached autoXXX modules. Curiously the sfGuardUser works in this respect on both platforms.
The debug log is identical until the step
Call "sfGuardGroupActions->executeIndex()"
The local version continues correctly with
Render "sf_app_dir/modules/sfGuardGroup/templates/indexSuccess.php"
While the remote server goes on like this:
Render "sf_root_dir/cache/backend/dev/modules/autoSfGuardGroup/templates/indexSuccess.php"
I have never seen any difference in the behavior of my modules before and this really stumps me. The files in both locations are identical, except the ProjectConfiguration.class.php and database.yml. I haven't found any mention of this kind of problem. Do you have any idea what could be causing this?
Edit:
Of course I cleared the cache on both ends.
Well this is embarrassing!
Notice how autoSfGuardGroup is spelled? When I copied the cached folder I took out the 'auto', leaving a capital 'S' in front of the name. My Mac happily ignored the caps but the hosted server was not so nice.
All is well now.
Maybe I should get new glasses ... 8-}

Runtime error but project compiles fine - Imports/using missing

I am very confused right now. I have VS2008 at my job right now and I have a weird behavior that I have been searching for a while now.
When I compile the project, it works fine, but in runtime I have an error saying object not defined or something like that. The problem is that the imports/using is missing in my class but why does it compile?
In fact, I want to be able to see that error when compiling not when running the webapp.
REEDITED: Here is an example. Lets say i want to use a typed list, I am declaring my object list(of int) for example without having added my imports (system.collection.generic) in the class. then I compile, it works and then I run it, it fails because of the imports missing. is this normal behavior or not?
REREEDITED: I just noticed that the DLL of all my references were not copied in my bin folders even though all of them are set to "Copy local = true". Is it possible that it has to do with our shared directory (all external dlls) being on a network drive (\server\shared). I am really out of ideas on this issue....
problem was because we were having the classes in the app_data folder
The answer to the current question - why you are getting this error - is that ASP.NET does not show many errors at compile-time. You will need to manually go through the application to verify that all pages work correctly. This is very common with ASP.NET development, due to the nature of the environment.
If you post the real errors (probably should be as another SO question), we can perhaps help you with them.
Remove all the dll, etc from bin...
rebuild the whole solution then run
It should run fine...

Resources