ecwyne / meteor-polymer-elements

Add polymer-elements to Meteor project
https://atmospherejs.com/ecwyne/polymer-elements
59 stars 14 forks source link

Using block or template helpers breaks iron router. #12

Closed vangorra closed 9 years ago

vangorra commented 9 years ago

I have a project setup with iron router. It uses a global layout and renders a toolbar and main content. Using either the block or template helpers breaks routing to a point where pages don't load or templates are loaded on top of each other.

{{#paper_button}}Hello{{/paper_button}}
{{>paper_button}}

I get these errors:

Uncaught TypeError: flags.log.split is not a function
xception in queued task: Error: Expected template or null, found: [object Object]
    at Object.Spacebars.include (http://localhost:3000/packages/spacebars.js?7f53771c84a2eafac2b561c9796dda0d8af8e7f5:53:13)
    at null._render (http://localhost:3000/client/views/template.controller.js?ef1bd90ee3f54a8434423c921ac49a59f6397c5d:80:38)
    at doRender (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1866:25)
    at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1808:16
    at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2043:12)
    at viewAutorun (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1807:18)
    at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:296:36)
    at new Tracker.Computation (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:214:10)
    at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:487:11)
    at Blaze.View.autorun (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1806:19)

If I use regular html tags, these errors are not present.

ecwyne commented 9 years ago

I'm not sure I understand. Any chance you can make a simple reproduction or share your code?

ecwyne commented 9 years ago

I've got it working as far as I can see here.

https://github.com/ecwyne/polymer-elements-12

vangorra commented 9 years ago

Admittedly, I cannot reproduce from a new project. Trying to nail down the repro steps.

vangorra commented 9 years ago

Using your example project, change the path from /hello to /hello/world. The helpers.js#linkFunction will generate a relative, not absolute path. webcomponents.js gets really angry and throw the following warning a bunch of times.

Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

In my larger app, I have switched from a multi-depth path to a single one and ALL the errors have gone away.

ecwyne commented 9 years ago

Awesome, thanks for catching that! Just published 1.0.8! Will you confirm that all issues are fixed

vangorra commented 9 years ago

Confirmed fixed. It's working so much better now.

On Thu, Mar 12, 2015 at 4:20 PM Eric Wyne notifications@github.com wrote:

Awesome, thanks for catching that! Just published 1.0.8! Will you confirm that all issues are fixed

— Reply to this email directly or view it on GitHub https://github.com/ecwyne/meteor-polymer-elements/issues/12#issuecomment-78687226 .