ManuelDeLeon / viewmodel-react

Create your React components with view models.
MIT License
24 stars 3 forks source link

parseBind.js:35 Uncaught TypeError: Cannot read property 'charCodeAt' of undefined #4

Closed fvpDev closed 7 years ago

fvpDev commented 8 years ago

What could be causing this error? I imagine this has to do with bindings? I can't tell whether this is coming from viewmodel-react or viewmodel-react-plugin, for in browser const or export const is converted to var (idk which). Attribute bindings aren't working yet.

Also, not sure if it makes a difference, as it seems that the plugin is registering, but I switched from using .babelrc to including babel config in package.json like so:

"babel": {
  "plugins": [
    ["viewmodel-react-plugin", {
      "attributes": [
        "id",
        "src", "alt",
        "href", "title", "target",
        "type", "placeholder", "autocomplete",
        "rows", "cols",

        "xlinkHref",
        "viewBox", "width", "height",
        "transform", "x", "y", "cx", "cy", "x1", "y1", "x2", "y2",
        "r", "rx", "ry",
        "d", "points",
        "fill", "fillOpacity", "fillRule",
        "stroke", "strokeOpacity", "strokeWidth",
        "fontSize", "textAnchor", "alignmentBaseline"
      ]
    }]
  ]
},
ManuelDeLeon commented 8 years ago

The only thing I can think of is that you have a malformed binding. What are you doing?

fvpDev commented 8 years ago

Could something like this be the problem (whitespace)?:

<text b="id: id,
         x: ox, y: oy,
         fill: fColor, fillOpacity: fOpacity, fillRule: fRule,
         fontSize: size, textAnchor: textAnchor, alignmentBaseline: alignBase,
         transform: transformStr">
ManuelDeLeon commented 8 years ago

That should work (breaking it into different lines)

fvpDev commented 8 years ago

I have another case where I am binding a property inherited from a mixin...?

ManuelDeLeon commented 8 years ago

I need a repro =/

Use this clean project: https://github.com/ManuelDeLeon/viewmodel-react-starter

fvpDev commented 8 years ago

It's going to take a little to isolate the issue, I'll get back to you

ManuelDeLeon commented 7 years ago

Going to close this for now (I'm cleaning up the issues). Let me know if you can repro it.