hexops / vecty

Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.
BSD 3-Clause "New" or "Revised" License
2.8k stars 143 forks source link

Failed Running The Example #305

Closed KiddoV closed 2 years ago

KiddoV commented 2 years ago

I download the example and...

$ cd markdown $ go mod tidy

...and got this error:

go: finding module for package github.com/hexops/vecty/style
go: finding module for package github.com/hexops/vecty/event
go: finding module for package github.com/hexops/vecty/elem
go: finding module for package github.com/hexops/vecty/prop
github.com/hexops/vecty/example/hellovecty imports
        github.com/hexops/vecty/elem: module github.com/hexops/vecty@latest found (v0.6.0, replaced by ../), but does not contain 
package github.com/hexops/vecty/elem
github.com/hexops/vecty/example/markdown imports
        github.com/hexops/vecty/event: module github.com/hexops/vecty@latest found (v0.6.0, replaced by ../), but does not contain package github.com/hexops/vecty/event
github.com/hexops/vecty/example/todomvc/components imports
        github.com/hexops/vecty/prop: module github.com/hexops/vecty@latest found (v0.6.0, replaced by ../), but does not contain 
package github.com/hexops/vecty/prop
github.com/hexops/vecty/example/todomvc/components imports
        github.com/hexops/vecty/style: module github.com/hexops/vecty@latest found (v0.6.0, replaced by ../), but does not contain package github.com/hexops/vecty/style

any idea?

VinceJnz commented 2 years ago

'go get'

soypat commented 2 years ago

I tried the following and got no error:

$ git clone git@github.com:hexops/vecty.git
$ cd vecty/example/markdown/
$ go mod tidy
go: downloading github.com/slimsag/blackfriday v2.0.0+incompatible
go: downloading github.com/microcosm-cc/bluemonday v1.0.2
go: downloading golang.org/x/net v0.0.0-20181220203305-927f97764cc3

Are you running this example from inside the vecty project? Did you create your own go.mod file?

KiddoV commented 2 years ago

@soypat yes. I create my own go.mod cuz inside the markdown only have 1 go file

soypat commented 2 years ago

Change your imports to be

import (
    "github.com/hexops/vecty"
    "github.com/hexops/vecty/elem"
    "github.com/hexops/vecty/event"
    "github.com/microcosm-cc/bluemonday"
    "github.com/russross/blackfriday/v2"
)

And run go mod tidy again.

What is causing the problem is "github.com/slimsag/blackfriday", which has a malformed go.mod file

KiddoV commented 2 years ago

@soypat It works! Thanks!

KiddoV commented 2 years ago

But now I got this error running with gopherjs serve

Capture

Any idea?

soypat commented 2 years ago

Use wasmserve!

Please read the example instructions https://github.com/hexops/vecty/tree/main/example

KiddoV commented 2 years ago

Thanks, it works now!