Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

blaze-refactor branch - error with dynamic attributes. #46

Closed
sbking opened this issue Jul 17, 2014 · 2 comments
Closed

blaze-refactor branch - error with dynamic attributes. #46

sbking opened this issue Jul 17, 2014 · 2 comments
Labels

Comments

@sbking
Copy link
Contributor

sbking commented Jul 17, 2014

When trying to use dynamic attributes, I get the following error:

Exception from Deps recompute function: Error: The basic HTML.TransformingVisitor does not support foreign objects in attributes.  Define a custom visitAttributes for this case.
    at HTML.TransformingVisitor.def.visitAttributes (http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:212:13)
    at Blaze.HTMLJSExpander.def.visitAttributes (http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1897:63)
    at Object.Blaze._expandAttributes (http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1919:32)
    at updateAttributes (http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1369:35)
    at http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1738:16
    at Object.Blaze.withCurrentView (http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1963:12)
    at viewAutorun (http://localhost:3000/packages/blaze.js?ce45a8e727ecde8642e599cbb8eb3f52cea9ba4b:1737:18)
    at Deps.Computation._compute (http://localhost:3000/packages/deps.js?d9b2b2601bdab0f57291b38e7974a7190b8aac01:214:36)
    at new Deps.Computation (http://localhost:3000/packages/deps.js?d9b2b2601bdab0f57291b38e7974a7190b8aac01:148:10)
    at Object.Deps.autorun (http://localhost:3000/packages/deps.js?d9b2b2601bdab0f57291b38e7974a7190b8aac01:362:11) 

Here is my smart.json:

{
  "meteor": {
    "git": "https://github.com/meteor/meteor.git",
    "branch": "blaze-refactor"
  },
  "packages": {
    "jade": {
      "git": "https://github.com/mquandalle/meteor-jade",
      "branch": "blaze-refactor"
    },
    "iron-layout": {
      "git": "https://github.com/EventedMind/iron-layout.git",
      "branch": "master"
    },
    "iron-router": {
      "git": "https://github.com/EventedMind/iron-router.git",
      "branch": "feature/iron-layout"
    },
    "underscore-string-latest": {}
  }
}
@mquandalle
Copy link
Owner

Could you please share the concerned template?

@mquandalle mquandalle added the bug label Jul 17, 2014
@sbking
Copy link
Contributor Author

sbking commented Jul 17, 2014

It happens whenever I try to have dynamic attributes returned from a helper that is passed an argument:

template(name="foo")
  div($dyn="{{attributes 'argument'}}")

Using this syntax:

template(name="foo")
  div($dyn="#{attributes 'argument'}")

I get the error:

Exception from Deps recompute function: Error: Illegal HTML attribute name: 0

However, I seem to be able to use a helper that doesn't take arguments (but this doesn't really help me):

template(name="foo")
  div($dyn=attributes)

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

No branches or pull requests

2 participants