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

export is not defined #411

Open
BinaryRyan opened this issue Aug 19, 2024 · 0 comments
Open

export is not defined #411

BinaryRyan opened this issue Aug 19, 2024 · 0 comments

Comments

@BinaryRyan
Copy link

BinaryRyan commented Aug 19, 2024

Steps to reproduce

1.read xterm-headless from js file
2.run this script in v8 engine

ReferenceError: exports is not defined [recovered]
	iso := v8.NewIsolate()

	xtermScript, err := fileutil.ReadFileToString("../js/xterm-headless.js")
	if err != nil {
		panic(err)
	}

	ctx := v8.NewContext(iso)
	_, err = ctx.RunScript(xtermScript, "xterm-headless.js")
	if err != nil {
		panic(err)
	}
    var r = exports;
    for (var n in s) r[n] = s[n];
    s.__esModule && Object.defineProperty(r, "__esModule", {
        value: !0
    })
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

1 participant