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

SSR compiler produces error with component refs #216

Closed
alizauf opened this issue Dec 20, 2016 · 1 comment · Fixed by #217
Closed

SSR compiler produces error with component refs #216

alizauf opened this issue Dec 20, 2016 · 1 comment · Fixed by #217
Labels
Milestone

Comments

@alizauf
Copy link

alizauf commented Dec 20, 2016

I'm trying to access a component using a ref, but I receive the below error.

example:

<div>
  <Background ref:componentRef />
</div>
Stack trace

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at node.attributes.map.attribute (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:7338:31)
at Array.map (native)
at Object.enter (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:7333:33)
at Object.enter (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:7373:16)
at SsrGenerator.visit (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:6905:32)
at node.children.forEach.child (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:6913:10)
at Array.forEach (native)
at SsrGenerator.visit (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:6912:18)
at node.children.forEach.child (/Users/aliza.aufrichtig/Sites/2016-12-local-guns/node_modules/svelte/compiler/svelte.js:6913:10)
at Array.forEach (native)

@Rich-Harris Rich-Harris added this to the ASAP milestone Dec 20, 2016
Rich-Harris added a commit that referenced this issue Dec 20, 2016
handle directives on components
@Rich-Harris
Copy link
Member

Thanks – fixed in 1.5.0

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

Successfully merging a pull request may close this issue.

2 participants