publiclab / mapknitter

Upload your own aerial images, position (rubbersheet) them in a web interface over existing map data, and share via web or composite and export for print.
http://mapknitter.org
GNU General Public License v3.0
267 stars 207 forks source link

Cannot read property '_map' of undefined #916

Closed jywarren closed 5 years ago

jywarren commented 5 years ago

In stable, i'm now seeing an error on this page: http://mapknitter-stable.laboratoriopublico.org/maps/central-park-nyc

Uncaught TypeError: Cannot read property '_map' of undefined

around this line:

window.mapKnitter._map.fitBounds(bounds),images.push(i),i.warpable_id

I believe it's on this line, but not sure:

https://github.com/publiclab/mapknitter/blob/a79a86f2af01a7d1b5a9623616fd043228ebb267/app/assets/javascripts/maps.js#L22

This seems to be preventing any manipulation of images.

jywarren commented 5 years ago

Could be related to #892, see https://github.com/publiclab/mapknitter/commit/a79a86f2af01a7d1b5a9623616fd043228ebb267 - yes, for sure!

jywarren commented 5 years ago

I think it's that for some reason window.mapknitter is not initialized by the time we call it?

jywarren commented 5 years ago

Oh wait! I think it's that the rake assets:precompile step didn't run! I'll manually run that in staging now.

jywarren commented 5 years ago

OK, i'm getting error: Uglifier::Error: Unexpected token name «i», expected punc «;». To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).

jywarren commented 5 years ago

OK, addressed that in #917, i believe...

jywarren commented 5 years ago

Now waiting for stable to build so we can test out the compiled assets in http://mapknitter-stable.laboratoriopublico.org/maps/central-park-nyc

jywarren commented 5 years ago

Hmm. NameError: uninitialized constant Uglifier

jywarren commented 5 years ago

Trying adding require 'uglifier' before the line in config/environments/production.rb

jywarren commented 5 years ago

https://jenkins.laboratoriopublico.org/job/Mapknitter-Stable/243/

jywarren commented 5 years ago

That worked and it passed the jenkins build for the first time!

jywarren commented 5 years ago

OK, now re-ran RAILS_ENV=production COMPOSE_PROJECT_NAME=mapknitter_stable PORT=6002 docker-compose exec web rake assets:precompile and am rebuilding the container.

jywarren commented 5 years ago

OK, now we seem ok after rebuilding the container!

jywarren commented 5 years ago

Map creation seems fine. Closing this now!