livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.53k stars 182 forks source link

Dev server breaks as soon as I generate a new controller #407

Open fgrehm opened 11 months ago

fgrehm commented 11 months ago

Hey there!

I was going to give bud a shot and unfortunately I got stuck right after generating a new controller, getting this error:

| genfs: open "bud/cmd/app/main.go". genfs: open "bud/internal/web/web.go". genfs: open
"bud/internal/web/controller/controller.go". framework/controller: unable to load. controller: unable to load:
"/snap/go/current/src/context" can't be outside the module directory "/snap/go/10257/src"

To reproduce:

curl -sf https://raw.githubusercontent.com/livebud/bud/main/install.sh | sh
bud create hello
cd hello

# in one tab
bud run

# in another tab
bud new controller home:/ index

As soon as the browser attempts to refresh the page that error occurs, the browser hangs and the request never completes. If I stop the server and try to spin it up again I get the same error and it never comes up.

Some information about my environment:

go env (click to expand) ``` GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/fabio/.cache/go-build" GOENV="/home/fabio/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/fabio/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/fabio/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/snap/go/current" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/snap/go/current/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.20.6" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/fabio/projects/playground/hello/go.mod" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build332917642=/tmp/go-build -gno-record-gcc-switches" ```
zeitue commented 10 months ago

Same issue on Ubuntu 23.04 bud: 0.2.8 svelte: 3.47.0 react: 18.0.0 go version go1.20.3 linux/amd64 installed from deb

| Listening on http://127.0.0.1:3000
| genfs: open "bud/cmd/app/main.go". genfs: open "bud/internal/web/web.go". genfs: open "bud/internal/web/controller/controller.go". framework/controller: unable to load. controller: unable to load: "/usr/lib/go-1.20/src/context" can't be outside the module directory "/usr/share/go-1.20/src"
matthewmueller commented 10 months ago

Sorry for the trouble here. I think this is related to: https://github.com/livebud/bud/issues/369.

I probably won't devote cycles to this since I'm working on a new version of Bud that won't have issues like this. But if you figure it out, please let me know!