Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue error and displaying wrong data #11

Closed
marionnewlevant opened this issue Dec 26, 2017 · 3 comments
Closed

Vue error and displaying wrong data #11

marionnewlevant opened this issue Dec 26, 2017 · 3 comments
Assignees

Comments

@marionnewlevant
Copy link
Collaborator

Poking around Oregon, I notice that the Springfield/Eugene star is showing what looks like the Coos Bay popup, and giving errors inthe console:

vue.js:584 [Vue warn]: Error in render: "TypeError: Cannot read property 'month' of undefined"

(found in )
warn @ vue.js:584
logError @ vue.js:1715
globalHandleError @ vue.js:1710
handleError @ vue.js:1699
Vue._render @ vue.js:4467
updateComponent @ vue.js:2765
get @ vue.js:3113
run @ vue.js:3190
flushSchedulerQueue @ vue.js:2954
(anonymous) @ vue.js:1815
flushCallbacks @ vue.js:1736
Async Call
microTimerFunc @ vue.js:1784
nextTick @ vue.js:1828
queueWatcher @ vue.js:3041
update @ vue.js:3180
notify @ vue.js:690
reactiveSetter @ vue.js:1015
proxySetter @ vue.js:3271
showFeature @ map.js:280
boundFn @ vue.js:196
(anonymous) @ map.js:186
e @ lodash.js:10350
a @ lodash.js:10397
f @ lodash.js:10385
setTimeout (async)
Cs @ lodash.js:6663
s @ lodash.js:10434
s @ map.js:632
Evented.fire @ evented.js:94
h @ bind_handlers.js:144
u @ bind_handlers.js:80

vue.js:1719 TypeError: Cannot read property 'month' of undefined
at Proxy.eval (eval at createFunction (vue.js:10518), :2:503)
at Vue$3.Vue._render (vue.js:4465)
at Vue$3.updateComponent (vue.js:2765)
at Watcher.get (vue.js:3113)
at Watcher.run (vue.js:3190)
at flushSchedulerQueue (vue.js:2954)
at Array. (vue.js:1815)
at flushCallbacks (vue.js:1736)
at

@marionnewlevant
Copy link
Collaborator Author

This is the data in the json file that causes the problem. It doesn't always show Coos Bay, just whichever one was hovered over just before.

    {
      "properties": {
        "source": "events",
        "affiliate": false,
        "name": "Women's March for Action",
        "eventDate": "1/20/2017",
        "eventLink": "https://www.facebook.com/events/169175637014466/",
        "location": "Eugene, OR",
        "host": "Women's March for Action",
        "contactName": "",
        "contactEmail": "",
        "facebook": "https://www.facebook.com/Womens-March-for-Action-418414951908677/",
        "twitter": "",
        "instagram": "",
        "motpLink": "http://marchonthepolls.org/event/Womens-March-Eugene"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -123.0951,
          44.0505
        ]
      },
      "type": "Feature"
    },

@marionnewlevant
Copy link
Collaborator Author

marionnewlevant commented Dec 28, 2017

Almost for sure the problem is that that eventDate is in the past.
Here is showFeature:

    showFeature: function showFeature(feature) {
      const props = feature.properties;

      props.mailto = 'mailto:' + props.contactEmail;
      if (props.eventDate) {
        props.eventMeta = _.find(this.events, function(ev) {
          return ev.location === props.location && !ev.past;
        });
      }
      this.activeGroup = props;
    },

The feature has an eventDate (in the past), but it doesn't exist in this.events (which filters out events in the past), so we get props.eventMeta = undefined, and then we crash (and render the previous popup).

@marionnewlevant
Copy link
Collaborator Author

Still failing at assigning github issues to me, but I have a plan to fix this:

  1. consider recently past events as current
  2. filter out distant past events entirely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant