Stream: beginners

Topic: roc website isn't running locally


view this post on Zulip Sahil (Nov 21 2024 at 11:39):

I followed everything from the following doc: https://github.com/roc-lang/roc/tree/main/www
Everything worked perfectly fine but when I ran bash ./www/build-dev-local.sh. I got this in the terminal -->
Screenshot 2024-11-21 at 17.07.04.png

view this post on Zulip Sahil (Nov 21 2024 at 11:41):

How to run the project so that I can execute localhost:8080

view this post on Zulip Sam Mohr (Nov 21 2024 at 11:48):

So it looks like we build the website and then run a command called simple-http-server to run the website locally

view this post on Zulip Sam Mohr (Nov 21 2024 at 11:49):

If you have nix installed and run nix develop in the root dir, it'll install that tool for you

view this post on Zulip Sam Mohr (Nov 21 2024 at 11:49):

You can otherwise install it from the GitHub page: https://github.com/TheWaWaR/simple-http-server

view this post on Zulip Sahil (Nov 21 2024 at 11:59):

i did run nix develop

view this post on Zulip Sahil (Nov 21 2024 at 11:59):

I followed al these steps:
git clone https://github.com/roc-lang/roc.git
cd roc
nix develop
./www/build.sh

make the roc command available

export PATH="$(pwd)/target/release/:$PATH"
bash ./www/build-dev-local.sh

view this post on Zulip Luke Boswell (Nov 21 2024 at 12:05):

Looks like that local script might be broken.

Can you try doing it manually?

This should serve the files you just built

$ cd www/dist/
$ simple-http-server -p 8080 --nocache --cors --index -- dist/

view this post on Zulip Luke Boswell (Nov 21 2024 at 12:05):

You can install that with cargo install simple-http-server if you don't have it

view this post on Zulip Sahil (Nov 21 2024 at 12:13):

yeah it worked

view this post on Zulip Sahil (Nov 21 2024 at 12:13):

thank you


Last updated: Jul 06 2025 at 12:14 UTC