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

console.log unreachable when used in a component event #1278

Closed
aldomendez opened this issue Mar 26, 2018 · 1 comment · Fixed by #1311
Closed

console.log unreachable when used in a component event #1278

aldomendez opened this issue Mar 26, 2018 · 1 comment · Fixed by #1311
Labels

Comments

@aldomendez
Copy link

https://svelte.technology/repl?version=1.58.0&gist=09304b4620a1c31a3387457ca53b795f

<svg viewBox='0 0 1000 1000' style='width: 100%; height: 100%;'>
    {{#each icons as icon}}
    <Icon x="{{icon.x}}" y="{{icon.y}}" z="{{icon.size}}" fill="{{icon.fill}}" icon="{{icon.i}}" 
on:drg='console.log(icon)'/> {{/each}}
----------^^^^^^^^^^
...

To make it fail you should click on an icon in the output window

Stack trace Chrome

Uncaught TypeError: Cannot read property 'log' of undefined
at Icon.eval (eval at createComponent (repl.0.js:1), :211:22)
at Icon.c [as fire] (shared.js:1)
at SVGGElement.click_handler (eval at createComponent (repl.0.js:1), :29:14)

Stack trace Firefox

TypeError: component.console is undefined
...

Current proposed work arround is shown here: https://svelte.technology/repl?version=1.58.0&gist=9b0a4442260d58bc1136c8d3c0669d59

@Rich-Harris
Copy link
Member

Thanks — this is fixed in 1.60.2

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