Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Google Maps API TypeError: Unable to delete property #12836

Closed
visnup opened this issue Dec 18, 2014 · 21 comments
Closed

Google Maps API TypeError: Unable to delete property #12836

visnup opened this issue Dec 18, 2014 · 21 comments

Comments

@visnup
Copy link

visnup commented Dec 18, 2014

When using latest phantomjs 1.9.8, trying to load a web page that has a Google map results in a thrown TypeError with message "Unable to delete property". The stack trace (of minified code) is:

TypeError: Unable to delete property.
   :219
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:20
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:20
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:19
   :218
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:20
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:20
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:21
   :176
   :31
   https://maps.gstatic.com/maps-api-v3/api/js/19/4/main.js:26
   :178

As of Dec 16 and v3.18, this test case worked. Also, as of Dec 10 and v3.exp everything was fine too. It was only when patch releases on maps.gstatic.com were released that we started seeing these issues. I filed a matching issue against Google Maps API too.

A simplified test case is:

var page = require('webpage').create();

page.onError = function(message, trace) {
  console.log(message);
  trace.forEach(function(item) {
    console.log('  ', item.file + ':' + item.line);
  })
}

var url = 'https://developers.google.com/maps/documentation/javascript/examples/map-simple';
page.open(url, function() {
  page.render('example.png');
  setTimeout(function() { phantom.exit() }, 3000);
});
@yaronel
Copy link

yaronel commented Dec 19, 2014

Also happens to me with version 1.9 and 1.9.7

@anickle
Copy link

anickle commented Dec 19, 2014

Also happens with us. We use Capybara, Poltergeist, and PhantomJS 1.9.7. For us, this is a recent issue. We temporarily fixed it by switching to the release branch of the Google maps API, but eventually the code that was causing the problem got pushed into the release version of their API.

Since there are no JavaScript errors in Chrome, FireFox, or Safari on the same pages that cause PhantomJS to complain, this is most likely a bug with PhantomJS and not with the Google maps API.

@joshandnoodles
Copy link

Having the same issue but while running Google Maps embedded in a PyQt4 application. The javascript runs in the QWebView widget that utilizes Qt's WebKit implementation. Was working perfectly up to two days ago until I started getting the 'Unable to delete property' error. After I set the api version back, it started working again until today where I started getting the same error but unable to fix the issue. Since I am not utilizing PhantomJS anywhere in my program, I am guessing the scope of this issue is much larger.

@visnup
Copy link
Author

visnup commented Dec 22, 2014

As a workaround, we switched to capybara-webkit for our feature specs in our project and don't get the same error. There were minimal changes we had to make to our testing code, but it's working for now. Would still like to see a fix for phantom if possible though.

@foliveira
Copy link

I'm also having this issue, but somehow there's a twist to my side of the story.

The issue is only reproducible on machines running Mac OS, while it seems that Linux boxes are not affected by it.

The test suite is being run by Karma and PhantomJS 1.9.8

@wkrsz
Copy link

wkrsz commented Dec 23, 2014

I'm seeing this error too, but the map does load correctly, clicking markers works too. In my app errors are caught by TraceKit and sent to the server. Server sends emails in production (where this error doesn't happen) and prints to $stderr in test and development. I only needed to silence this one little error so as not to pollute test output:

TraceKit.report.subscribe(function(errorReport) {
  if (window.Rails.env === "development" || window.Rails.env === "test") {
    if (errorReport.message !== "Unable to delete property.") {
      // http://stackoverflow.com/questions/27429129/phantomjs-javascript-errors-from-gstatic-but-not-in-browser
      console.log('TraceKit report', JSON.stringify(errorReport))
    }
  } else {
    jQuery.ajax({
      url: "/report_error/",
      type: "POST",
      data: {
        error_report: errorReport,
        extra: window.loggingInformation
      }
    });
    return true;
  }
});

Does this error break some required functionality for you?

@yaronel
Copy link

yaronel commented Dec 23, 2014

The error is definitely breaking functionality.
If you catch the exceptions, then at least it doesn't affect other stuff, but still the map is essentially broken because it is not centered where it needs to be.
I also found that the exception is being thrown in other instances besides calls relating to the map bounds or center. But I didn't try to trace which other calls.

@anickle
Copy link

anickle commented Dec 23, 2014

We are running Capybara+Poltergeist+PhantomJS on Mac OS X Yosemite; I don't
have the ability to test if this is also a problem on Linux.

On Tue, Dec 23, 2014 at 11:51 AM, Yaron notifications@github.com wrote:

The error is definitely breaking functionality.
If you catch the exceptions, then at least it doesn't affect other stuff,
but still the map is essentially broken because it is not centered where it
needs to be.
I also found that the exception is being thrown in other instances besides
calls relating to the map bounds or center. But I didn't try to trace which
other calls.


Reply to this email directly or view it on GitHub
#12836 (comment).

@visnup
Copy link
Author

visnup commented Dec 23, 2014

we receive the errors on both OS X yosemite and in circleci (ubuntu 12.04).

@DouweM
Copy link

DouweM commented Jan 5, 2015

I'm seeing the same error, which is preventing our tests on Circle CI from succeeding.

@23tux
Copy link

23tux commented Jan 7, 2015

+1 Same error with phantomjs 1.9.8 on Mac OS X 10.9.5

@iradul
Copy link
Contributor

iradul commented Jan 8, 2015

With PhantomJS 2.0 this is working just fine.

@yaronel
Copy link

yaronel commented Jan 9, 2015

I can confirm it works for me with PhantomJS 2.0 as well, though since it's not a stable release I am worried what other things might break.

You can download it from here:
https://github.com/bprodoehl/phantomjs/releases

@shahafabileah
Copy link

Looks like I'm hitting the error too:

TypeError: Unable to delete property.
1
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 19 in bf
2
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 19 in bf
3
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 18 in [anonymous]
4
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 19 in bf
5
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 19 in bf
6
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 19 in bf
7
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 18 in [anonymous]
8
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 27 in [anonymous]
9
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 51 in [anonymous]
10
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 26 in ag
11
File https://maps.gstatic.com/maps-api-v3/api/js/18/20/main.js line 51 in [anonymous]
12
File https://<my-server>/<my-minified-code>.js line <whatever> in refreshMapMarkers

My code is making this call:

                // If there are 2+ markers, assume it's safe to use the bounds.
                map.fitBounds(bounds);

The error happened one time in our dev environment and got logged. It might be PhantomJS-related (we use that for tests) or it might be Mac OSX related (all our dev machines or Macs).

@fiedl
Copy link

fiedl commented Jan 24, 2015

Same error with OS X Yosemite 10.10.1 (14B25), ruby 2.1.2p95, phantomjs 1.9.8, poltergeist-1.5.0.

The error does not appear on travis for us.

@robd
Copy link

robd commented Jan 26, 2015

Using the latest experimental version of Google Maps (v3.19), which includes a workaround, fixed this problem for me: https://code.google.com/p/gmaps-api-issues/issues/detail?id=7475#c20

@yulinwang
Copy link

Yes, Google has provided the fix in version 3.19, but not released yet, so you have to specify version explicitly right now.
If using Google Map API, you can set version to 3.19 in URL to include the fix, like "https://maps.googleapis.com/maps/api/js?v=3.19"
But if using Google Charts API, there's no way to specify Google Map's version.
Finally we find a workaround to load both Google Map and Google Charts to specify the version.

  // specify google charts version
    google.load('visualization', '1',{
        'packages' : [ 'map' ],
        'callback': function() {
           // specify google map version here
            google.load('maps', '3.19', {
                'callback' : drawMap
            });
        }
    });

Hope it helps.

fiedl added a commit to fiedl/wingolfsplattform that referenced this issue Feb 7, 2015
…Yosemite.

run specs: NO_JS_ERRORS=true bundle exec rake

see: ariya/phantomjs#12836
@robd
Copy link

robd commented Feb 17, 2015

Google maps 3.19, which fixes this problem (as discussed above) was released as the production version on the 17 Feb 2015, so I suggest that this issue could now be closed.

@JunichiIto
Copy link

I suggest that this issue could now be closed.

I agree. I confirmed "Unable to delete property" error fixed.

@ilife5
Copy link

ilife5 commented Mar 7, 2015

I also get this error when using phantom-limb

onError
{ '0': 'TypeError: Unable to delete property.',
  '1': 
   [ { file: 'http://localhost/kami-demo/src/vendor/phantom-limb.js',
       line: 114,
       function: '' } ] }

I add try catch to solve this problem

try {
   delete finger.target[onEventName];
} catch(e) {}

@ariya
Copy link
Owner

ariya commented Jan 24, 2016

The entire example script will be removed, we're not going to maintain such a fragile example script.

@ariya ariya closed this as completed Jan 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests