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

carton dev does not work with hot reload (on Ubuntu 22) #418

Open
felixf4xu opened this issue Jan 23, 2024 · 3 comments
Open

carton dev does not work with hot reload (on Ubuntu 22) #418

felixf4xu opened this issue Jan 23, 2024 · 3 comments

Comments

@felixf4xu
Copy link

felixf4xu commented Jan 23, 2024

Hi,

I'm trying to test the hot reload (with Ubuntu 22).

When I run carton dev -v, I got this:

Watching these directories for changes:
/home/cc/testcode/TokamakApp/Sources/TokamakApp
/home/cc/testcode/TokamakApp/Sources/TokamakAppLibrary

[ NOTICE ] Server starting on http://127.0.0.1:8080
Opening in existing browser session.
[ INFO ] GET / [request-id: 9429F254-E51E-4C65-A3C1-D296CA3A64AA]
[ INFO ] GET /main.wasm [request-id: A8A569DE-8E34-482D-ACA6-AFCA31F04B69]
[ INFO ] GET /favicon.ico [request-id: 59069EF7-BF0F-42F9-A798-2F55431B26EC]
[ INFO ] GET /watcher [request-id: FAB3E429-313C-4E8C-AEA1-FA29049EB417]
[ INFO ] GET /JavaScriptKit_JavaScriptKit.resources/Runtime/index.mjs [request-id: 9A012136-2FD2-4BB6-B0EF-20073F40B41A]
[ INFO ] GET /watcher [request-id: 2F4FEA85-E7A1-48E7-BF8C-DB7AA922EFA3]
[ INFO ] GET /watcher [request-id: AE91BC94-80F9-4FFF-898D-5CD38A6296BB]

Then I tried to edit App.swift like this:

struct ContentView: View {
    var body: some View {
        Text("Hello, world!")
        Text("Hello, world 2!")
        Text("Hello, world 4!")     //<-- add this line
    }
}

but nothing happened on the web page (google chome).

Only after I stop carton dev and re-run it, I can see the updated Text.

@kevinkleine
Copy link

kevinkleine commented Feb 20, 2024

Hot reloading also seems broken when running from a container (ghcr.io/swiftwasm/carton:latest, which is 0.20.1).
It is the same with the older carton images 0.20.0 and 0.19.1.

Carton logs:

Watching these directories for changes:
/test/Sources/test
/test/Sources/testLibrary

But when I change or add a file - either from inside or outside of the container - nothing is logged and no refresh of the webpage happens.

OS: Manjaro 23.1.3

Running the container with:
podman run --rm -v .:/test -p 0.0.0.0:8080:8080 -it ghcr.io/swiftwasm/carton:latest /bin/bash.

Running carton dev --host 0.0.0.0 -v inside the container.

@kateinoigakukun
Copy link
Member

Version 1.0 rewrote the dev server. Could you try again with the new version?

@jeremypenner
Copy link

I'm having the same issue with
docker run -v .:/src --privileged --interactive --tty --name swift-experiments -p 8080:8080 swift:5.9.2 /bin/bash
and then running
swift run carton dev --host 0.0.0.0 -v
from inside the container. My Package.resolved suggests that I'm running carton 1.0.3. The swift:5.9.2 docker image is based on Ubuntu "jammy" 22.04.4.

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

4 participants