livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.58k stars 180 forks source link

undefined: sqlite3.Error issue #405

Open abdyek opened 1 year ago

abdyek commented 1 year ago

When create a hello project, the CLI trows this error to me

⬢[abdyek@toolbox Go]$ bud create hello
| Created: go.mod
| Created: package.json
| Created: .gitignore
| Created: public/favicon.ico
| Installed: go modules
| Installed: node modules
# github.com/livebud/bud/internal/dag
../../../../go/pkg/mod/github.com/livebud/bud@v0.2.8/internal/dag/sqlite.go:345:27: undefined: sqlite3.Error
../../../../go/pkg/mod/github.com/livebud/bud@v0.2.8/internal/dag/sqlite.go:349:47: undefined: sqlite3.ErrReadonlyDbMoved
| exit status 1
DianWoung commented 1 year ago

same question

matthewmueller commented 1 year ago

Hmm, that's odd. What OS are you running on? Did you try running go mod tidy?

I sense it's related to: https://github.com/mattn/go-sqlite3/issues/384

DianWoung commented 1 year ago

this err shows on windows,I use intel Mac is ok

ErSauravAdhikari commented 1 year ago

I am still experiencing this issue. image

I tried to use go mod tidy as @matthewmueller pointed out. But this did not work as well.

Env: Linux/Mint

ErSauravAdhikari commented 1 year ago

I've manged to identify the problem. This is related to CGO.

For more information you can check about static builds on google.

TLDR Fix:

saurav@saurav:~/Workspace/livebud/gandaki$ go env -w CGO_ENABLED=1

I think we should look more into this. As ideally it would be better if works irrespective of CGO_ENABLED=1/0.