Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

TypeError: Cannot call method 'replace' of undefined #430

Closed
strk opened this issue Feb 19, 2016 · 4 comments
Closed

TypeError: Cannot call method 'replace' of undefined #430

strk opened this issue Feb 19, 2016 · 4 comments
Milestone

Comments

@strk
Copy link
Contributor

strk commented Feb 19, 2016

Attempts to render the following MML results in an exception being thrown.
I'm not sure if exception throwing is tolerated (I remember someone once told me carto was not supposed to throw?)

This happens as of commit 21be5fb (current master)

{
    "srs":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
    "Stylesheet": [
      {"id":"tile_style"}
    ],
    "Layer": [{
      "clear_label_cache": false,
      "queryable": false,
      "maximum_scale_denominator": 1.7976931348623157e+308,
      "minimum_scale_denominator":0,
      "datasource": {
        "type":"vector"
      },
      "styles": ["layer"],
      "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
      "active": true,
      "name": "layer"
    }]
}
@strk
Copy link
Contributor Author

strk commented Feb 19, 2016

I think the problem is in the missing data element in the Stylesheet only element.

@strk
Copy link
Contributor Author

strk commented Feb 19, 2016

I would provide a testcase but I cannot due to #429

@nebulon42 nebulon42 added the bug label Feb 26, 2016
@nebulon42
Copy link
Collaborator

Yes, that's it. The problem is actually in https://github.com/mapbox/carto/blob/master/lib/carto/renderer.js#L93 where the parser is called with s.data, which is undefined. No relation to the mentioned commit though, as it happened also before.

@nebulon42
Copy link
Collaborator

Related to #367.

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

No branches or pull requests

2 participants