7

I am getting "Uncaught TypeError" while using Google Map API V3 Javascript Library. I am not able to find the function due to which this error is coming. Do we have a uncompressed Javascript library for Google MAP API. If not please provide your suggestion to debug it. Thank you Regards, Dinesh

Dinesh P.R.
  • 6,936
  • 6
  • 35
  • 44
  • If you add the code that is causing the error to your question, the other developers on here will be able to give you more help. – Sean Mickey Jun 07 '12 at 13:22

2 Answers2

3

There is no uncompressed library. All the API methods are accessed according to the published documentation, so there doesn't need to be an uncompressed version. Follow the documentation and it will work.

To debug, use something like Firebug in Firefox. When it breaks on error, step back through the call stack until you reach your Javascript code. That will tell you what it's trying to execute.

It may be something as simple as providing a string value instead of a number.

Andrew Leach
  • 12,945
  • 1
  • 40
  • 47
  • This scores high in google so even though it's old I would add my question/comment here. Do you have experience using the map api with closure compiler? I read here and there that an externs should be used but most 3rd party libraries including the closure library is added uncompressed to your project so it won't include code you never use. It seems strange to me that google maps api is created to be compiled with closure but no uncompressed version is available for programmers to use. – HMR Sep 04 '13 at 14:02
  • 2
    I don't use Closure Compiler. But the answer remains: there is no uncompressed version. – Andrew Leach Sep 04 '13 at 14:06
  • Thank you for your reply, I haven't worked with the V3 maps API but it looks like you have to use an externs file of the API instead of the uncompiled library: https://groups.google.com/forum/#!topic/google-maps-js-api-v3/vgN7IqFIrws – HMR Sep 04 '13 at 14:32
  • Congrat for the bravery to give a negatory answer. – peterh Jul 03 '17 at 15:51
  • 2
    "I've never thought of a need for it, so you don't need it either," is neither bravery nor an answer. – Bob Stein Aug 09 '17 at 16:47
  • @BobStein-VisiBone If you read my answer, you will see that I don't say that. **Google** mandate (or did at the time of the answer) that all calls to the API must use the documented methods. That means that **Google** consider an uncompressed version not to be necessary. – Andrew Leach Aug 09 '17 at 16:56
  • Then how about rewording the 1st paragraph, something like: "There don't appear to be any uncompressed sources from Google. What there is from Google is excellent documentation, so don't forget to carefully check parameter types." Don't you think that's more accurate and less patronizing? I should have suggested this before downvoting. Thanks for being so responsive. – Bob Stein Aug 09 '17 at 17:58
  • I am getting and error `c.j is undefined` when I call placesService.search method. How am I supposed to debug with this information? – vishal May 30 '19 at 11:47
  • @serbia99 Every browser has some sort of debugger, but I'm afraid comments are not the place for a tutorial. I can't really say more than I have in the answer. Step back through the call stack and find what you're not supplying. – Andrew Leach May 30 '19 at 12:14
  • @AndrewLeach I figured it out. I am aware of the debugger but there is no stack trace. I traced it to the line in my code but the error came from a call to placesService.getDetails method in my code after which the stacktrace leads to the minified and garbled google javascript script. But anyway the main problem was that I was initializing placesService without parameter while it expects map parameter. So basically if there was an exception thrown when I initialize placesService without a parameter it would have been easy to figure out. – vishal May 30 '19 at 12:45
2

As mentioned, there isn't a way to get the original version with real (helpful) variable and comments

But! There's a new(ish?) feature in Google Chrome Dev Tools where you can de-minify code ("make minified code human readable")

https://developers.google.com/web/tools/chrome-devtools/javascript/reference#format

screenshot of human-readable feature in chrome dev tools

should at least help a bit with debugging

Max
  • 454
  • 4
  • 10