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

[Vega Err] PARSE DATA FAILED: table Error: Line 1: Unexpected token } #31

Closed
tomwayson opened this issue Jan 11, 2017 · 1 comment
Closed

Comments

@tomwayson
Copy link
Member

Similar to #27, after updating to the next version of cedar (0.8.0 in this case), I get an error in an app consuming this addon, but not in the dummy app, nor in JS Fiddle.

image

After much rage inducing WTF... I've traced that error down to the specification not getting correctly compiled from the template. The vega parser is choking on this line in the spec:

https://github.com/Esri/cedar/blob/95ec2b87bebcce26d4c75bc580469e826c29aa5b/src/charts/pie.json#L16

Which should have been transformed to read {"type": "pie", "field": "Number_of_SUM"}, in Cedar's supplant function. Digging further, that seems to be due to the fact that the for loop in getTokenValue() has been replaced w/ a for...in and in the app consuming this addon, tokenNameParts has the _super key in addition to the numeric array indexes (0 and 1). This causes getTokenValue to return null and that token is not replaced in the template.

While I don't understand why in one environment (the consuming app) the _super key is there, and in others (the dummy app or JSFiddle) it is not, I do think that Cedar should not use a for...in to loop through an array and hopefully that fixes this bug.

@tomwayson
Copy link
Member Author

I figured out why this didn't blow up in the dummy app - b/c addons are configured to not extend prototypes by default. Disabling this in the other app, by adding this to the other app's config solved the problem in the app:

    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      },
      EXTEND_PROTOTYPES: false
    },

That can be a temp fix until Esri/cedar#244 lands.

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

No branches or pull requests

1 participant