-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
#each Object.keys() works in REPL but not local #334
Comments
I can't reproduce the first issue. When running svelte-cli on the REPL example you gave, I'm getting As for your attempted workaround - |
Interesting, neither can I, using It's true it's not the exact same code, but I could see that it wasn't entirely relevant what the data key was called, hence my phrasing "same sort of code". If I can't figure out the svelte version problem then I might have to post a repo, since my minimal example does not fail, but let's see. Thanks for pointing out my workaround flaw, very true! Although I should be able to use |
Aha, what was needed: |
Actually no. |
Oh, I see. Thanks, that's a helpful insight. I'd forgotten about function purity not just being about side-effects. |
REPL: https://svelte.technology/repl/?version=1.10.0&gist=3e428aac25e50c913430174dd9160b65
Same sort of code locally (with svelte 1.10.0, svelte-cli 1.3.4) generates this output:
This doesn't exist, so the console gives an error:
Uncaught TypeError: Cannot read property 'keys' of undefined
Additionally, trying to add this workaround:
...and then call
#each routePaths()
results in babel giving anUnexpected token
error. It specifies line 152, which is beyond the end of my source file, so I'm assuming it's looking at some intermediate file when it says that, but there's nothing left in public/dist after it errors out.The text was updated successfully, but these errors were encountered: