Skip to content

TinyGo fails to compile a Vecty program #1282

@marwan-at-work

Description

@marwan-at-work

Hi there,
I have a simple Vecty program that compiles with Go but fails to compile with TinyGo:

package main

import (
	"github.com/gopherjs/vecty"
	"github.com/gopherjs/vecty/elem"
)

type comp struct {
	vecty.Core
}

func (c *comp) Render() vecty.ComponentOrHTML {
	return elem.Div(vecty.Text("hello"))
}

func main() {
	vecty.RenderBody(&comp{})
}

I was using Go modules and TinyGo v0.14.0 when running the following and got the error:

root@05844ebaa1e7:/app# tinygo build -o wasm.wasm -target=wasm .
# github.com/gopherjs/vecty
/go/pkg/mod/github.com/gopherjs/vecty@v0.0.0-20200328200803-52636d1f7aba/dom_wasmjs_gopherjs.go: interp: unknown GEP

traceback:
github.com/gopherjs/vecty/<init>:41:24:
  %15 = call %runtime._interface @"github.com/gopherjs/vecty.wrapObject"([0 x %runtime.funcValue] %12, i64 %13, i64* %14, i8* undef, i8* undef), !dbg !216

This is issue is a follow up on #93 - see this comment for more context.

It would be great to either solve this on the TinyGo side or the Vecty side.

CC: @slimsag @deadprogram

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestwasmWebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions