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

No app body on MacOS #257

Closed
GregoryVandromme opened this issue Sep 5, 2021 · 2 comments
Closed

No app body on MacOS #257

GregoryVandromme opened this issue Sep 5, 2021 · 2 comments
Labels

Comments

@GregoryVandromme
Copy link

Describe the bug

I have just created a fresh svelte project on my MacBook Pro. I have Node.js installed. When I run npm run dev it generates the usual messages in terminal with not errors. When I go on localhost:5000 there is no document body on safari and I get, Access to Localhost was Denied, HTTP Error 403 on chrome. This does not happen to any other of my node sites on react, express or any other framework, only svelte does this.

Reproduction

I have no error, I just run npx degit sveltejs/template my-project then cd into my-project, run npm install and npm dev. Then I simply go on my browser, safari or chrome and access http://localhost:5000.

Logs

There are no console logs and the server logs:
svelte-app@1.0.0 dev /Users/gregory/svelte-projects/russian-orthodox-church
> rollup -c -w

rollup v2.56.3
bundles ./src/main.js → public/build/bundle.js...
LiveReload enabled
created public/build/bundle.js in 225ms

[2021-09-05 13:17:14] waiting for changes...

> svelte-app@1.0.0 start /Users/gregory/svelte-projects/russian-orthodox-church
> sirv public --no-clear "--dev"


  Your application is ready~! 🚀

  - Local:      http://localhost:5000
  - Network:    Add `--host` to expose

────────────────── LOGS ──────────────────

System Info

npx: installed 1 in 0.912s

  System:
    OS: macOS 12.0
    CPU: (8) x64 Apple M1
    Memory: 41.90 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.5 - /usr/local/bin/node
    npm: 6.14.14 - /usr/local/bin/npm
  Browsers:
    Chrome: 93.0.4577.63
    Safari: 15.0
  npmPackages:
    rollup: ^2.3.4 => 2.56.3
    svelte: ^3.0.0 => 3.42.4

Severity

blocking all usage of svelte

@GregoryVandromme
Copy link
Author

I would like to add that all of this works perfectly fine on my Windows 10 Machine

@Conduitry Conduitry transferred this issue from sveltejs/svelte Sep 5, 2021
@GregoryVandromme
Copy link
Author

I have resolved the issue by changing the port from 5000 to 3000. It appears that port 5000 is a reserved port by macOS services, so that even when they are not running they are not allowed to be accessed or used by other apps. A simple fix for this could be just to change the port, or to add a separate template for MacOS with all of the filepaths starting with ./ as well. Just a thought.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants