Skip to content

misc/wasm: Microsoft Edge 18 (latest) crashes due to TextEncoder not being supported #27295

@silbinarywolf

Description

@silbinarywolf

What version of Go are you using (go version)?

go version go1.11 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Jake\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\GoProjects
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Jake\AppData\Local\Temp\go-build055571426=/tmp/go-build -gno-record-gcc-switches

What did you do?

I attempted to run a simple "hello world" WASM application on Microsoft Edge.

package main

import "fmt"

func main() {
	panic("Hello world")
}

What did you expect to see?

I expected that when I pressed F12 and opened the Developer Tools, there would be "Hello world" printed in the console logs with panic information, like in Google Chrome.

Console was cleared
wasm_exec.js:45 panic: Hello world
wasm_exec.js:45 
wasm_exec.js:45 goroutine 1 [running]:
wasm_exec.js:45 main.main()
wasm_exec.js:45 	D:/GoProjects/src/github.com/silbinarywolf/wasm-test/main.go:4 +0x2
wasm_exec.js:67 exit code: 2
exit @ wasm_exec.js:67
runtime.wasmExit @ wasm_exec.js:185
runtime.wasmExit @ wasm-004f446a-782:4
runtime.exit @ wasm-004f446a-771:3
runtime.fatalpanic.func2 @ wasm-004f446a-706:47
runtime.systemstack @ wasm-004f446a-727:100
runtime.fatalpanic @ wasm-004f446a-380:151
runtime.gopanic @ wasm-004f446a-374:887
main.main @ wasm-004f446a-879:50
runtime.main @ wasm-004f446a-401:590
_rt0_wasm_js @ wasm-004f446a-769:37
run @ wasm_exec.js:383
run @ wasm_exec.html:34
onclick @ wasm_exec.html:39

What did you see instead?

SCRIPT5009: 'TextEncoder' is not defined wasm_exec.js (64,1)
SCRIPT5009: 'Go' is not defined index_wasm.html (11,1)

This error occurs because Edge does not support TextEncoder, however, it does support WASM.
https://caniuse.com/#search=TextEncoder
https://caniuse.com/#search=wasm

Proposed solution

Explore polyfilling TextEncoder and including the polyfill inside misc/wasm/wasm_exec.js so that Edge will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-wasmWebAssembly issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions