Skip to content

SSR compiler produces error with component refs #216

@alizauf

Description

@alizauf

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions