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

Broken on Firefox #75

Closed
ghost opened this issue Dec 1, 2016 · 1 comment
Closed

Broken on Firefox #75

ghost opened this issue Dec 1, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 1, 2016

FF: Mozilla Firefox 50.0
Svelte: svelte-cli version 1.0.2
Command: svelte compile --format iife HelloWorld.html > HelloWorld.js

Background

After seeing your project on Hacker News, I decided to give it a shot. I use Firefox on Arch Linux, and I was surprised when the "Hello world" demo didn't work. To test it wasn't just my system, I tried it on chromium, and it worked fine there. Are you not supporting Firefox? (it is definitely a "legacy" browser)

Error

The problem is in the generated HelloWorld.js. It is located in var HelloWorld -> function HelloWorld -> function dispatchObservers -> for ( const key in group ). The error message reads SyntaxError: missing = in const declaration.

I hope this is just some obvious issue on my half, and not a lack of Firefox support...

@Rich-Harris
Copy link
Member

Ah, whoops! ES2015 habits are hard to break – Svelte is supposed to generate ES5 code but my fingers have forgotten how to type var. Should be a nice easy fix 😀

The real trick will be implementing automated tests to stop this from happening again.

Rich-Harris added a commit that referenced this issue Dec 1, 2016
prevent compiler from generating ES2015+ code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant