Skip to content
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

Error: Failed to convert Go file to JS #21

Open
annie-elequin opened this issue Apr 23, 2024 · 2 comments
Open

Error: Failed to convert Go file to JS #21

annie-elequin opened this issue Apr 23, 2024 · 2 comments
Assignees

Comments

@annie-elequin
Copy link

annie-elequin commented Apr 23, 2024

Describe The Bug

I run node index.js and it says "Failed to convert Go file to JS".

Info
Macbook Pro M3Pro (2024)
Sonoma 14.4.1
Node: v21.7.3
Go: 1.22.2

To Reproduce

I have included my minimal repo where this error happens. Just yarn and then node index.js

Error Stack

/Users/aelequin/coding/code-dump/node-go-require-test/node_modules/node-go-require/lib/go-loader.js:119
        throw new Error('Failed to convert Go file to JS\n' + output.stdout + '\n' + output.stderr);
        ^

Error: Failed to convert Go file to JS
null
null
    at GoLoader.runGoScript2JS (/Users/aelequin/coding/code-dump/node-go-require-test/node_modules/node-go-require/lib/go-loader.js:119:15)
    at GoLoader.loadGoScript (/Users/aelequin/coding/code-dump/node-go-require-test/node_modules/node-go-require/lib/go-loader.js:144:27)
    at Object.requireGo [as .go] (/Users/aelequin/coding/code-dump/node-go-require-test/node_modules/node-go-require/lib/node-go-require.js:66:14)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/aelequin/coding/code-dump/node-go-require-test/index.js:3:13)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)

Node.js v21.7.3

Code Sample

https://github.com/annie-elequin/node-go-require-test

@sagiegurari
Copy link
Owner

is gopherjs installed?

@annie-elequin
Copy link
Author

hi @sagiegurari thanks for your response!
I did run this:
go get -u github.com/gopherjs/gopherjs
and it is in go.mod, is there anything else I need to do? (I am new to go)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants