-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall/js: Wasm build in docker resulted in error gojs error is not object or function #61982
Comments
your wasm_exec.js doesn't line up with the one we distribute https://github.com/golang/go/blob/go1.21.0/misc/wasm/wasm_exec.js#L216 |
@seankhliao Can we move this to discussion as it's throwing error on following: src/LoadWasm/wasm_exec.js
Line 14:8: 'globalThis' is not defined no-undef
Line 16:5: 'globalThis' is not defined no-undef
Line 61:8: 'globalThis' is not defined no-undef
Line 62:5: 'globalThis' is not defined no-undef
Line 76:8: 'globalThis' is not defined no-undef
Line 80:8: 'globalThis' is not defined no-undef
Line 84:8: 'globalThis' is not defined no-undef
Line 88:8: 'globalThis' is not defined no-undef
Line 95:3: 'globalThis' is not defined no-undef
Line 241:13: 'fs' is not defined no-undef
Line 477:9: 'globalThis' is not defined no-undef
Line 486:10: 'globalThis' is not defined no-undef
Search for the keywords to learn more about each error. I added [eslint]
src/LoadWasm/wasm_exec.js
Line 241:13: 'fs' is not defined no-undef
Search for the keywords to learn more about each error. |
Got it working with some small changes in https://github.com/golang/go/blob/go1.21.0/misc/wasm/wasm_exec.js https://github.com/sujit-baniya/react-app-typescript-golang/blob/master/src/LoadWasm/wasm_exec.js Changes:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to build the wasm binary in Dockerfile to be used by React frontend. For the purpose I build a Dockerfile with following content.
Resource: https://github.com/sujit-baniya/react-app-typescript-golang/blob/master/Dockerfile
Then running the commands
What did you expect to see?
I expected to see the working version of application and don't see any error.
What did you see instead?
I see error on browser when visiting the application on browser
The text was updated successfully, but these errors were encountered: