Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Mac user issues: Unexpected token and site can't be reached #277

Closed
Download opened this issue Dec 26, 2021 · 0 comments · Fixed by #278
Closed

Mac user issues: Unexpected token and site can't be reached #277

Download opened this issue Dec 26, 2021 · 0 comments · Fixed by #278

Comments

@Download
Copy link

Download commented Dec 26, 2021

This is some feedback for you guys that may help you make enrollment a better experience for new Mac users.

I tried out Svelte today by following the instructions here:
https://svelte.dev/

npx degit sveltejs/template my-svelte-project
cd my-svelte-project
npm install
npm run dev

This gave me an Unexpected token error as described in #236. There is a solution in that thread as well that worked for me. However, a remark on Svelte.dev or maybe as the first line of this template's output when running npm run dev that the minimal Node JS version is... whatever it is, might be helpful. I guess running an old Node version is not that common, but when you do, like I did, you get no messages about versions whatsoever but just end up with a weird Unexpected token message that may cause some to conclude that Svelte is simply broken. I read a lot about Svelte and I am eager to try to use it, so I persisted this time. But I tried hundreds of different Open Source frameworks and libraries over the years and because so many of them are broken out of the box, I made it into sort of a rule that I would try the hello world sample first when looking at a project and only if that works flawlessly right away will I even look into the rest of the project. Because I have to save time somewhere so if the Hello World doesn't even run then forget about it. I broke this rule with Svelte because I am so enthousiastic about the ideas behind it, but really this is probably chasing a lot of new devs away.

The second thing I encountered was that after upgrading Node JS to latest, npm run dev did work, but when trying to access localhost:5000 I was greeted with This site can't be reached, as described in issue #184 I know that this issue has been acknowledged and has been reported to sirv, but I would still like to inform you that for Mac users, chances are currently very high that they will give up on Svelte before ever getting started because out of the box the Hello World example simply does not work as intended. So I think you can improve your enrollment experience quitte dramatically by implementing 2 small changes:

  1. Mention the minimum Node JS version, or possibly even detect it, in this template
  2. Change the default port of sirv to something that is not taken by default on Mac

Oh and just to leave you with some positive news as well:

Svelte is fast! The whole install using the instructions above happened within seconds and also npm install. and npm run dev were blazing fast. Also, when loading the web page it's just near-instant. That's the way it's supposed to be, but many projects out there are slow. You avoided that succesfully and that's a great achievement! Thank you for building Svelte! 👍

lukeed added a commit that referenced this issue Dec 29, 2021
- Closes #181
- Closes #184
- Closes #277
Rich-Harris pushed a commit that referenced this issue Jan 6, 2022
* chore: bump `sirv-cli` version;

- Closes #181
- Closes #184
- Closes #277

* chore: update readme port
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant