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

evalScript doesn't support module #380

Open
XuJiandong opened this issue Jan 10, 2025 · 1 comment
Open

evalScript doesn't support module #380

XuJiandong opened this issue Jan 10, 2025 · 1 comment

Comments

@XuJiandong
Copy link

❯ cat bar.mjs
import * as std from "std";

try {
    let result = std.evalScript(`
        import * as os from "os";
        os.getcwd()
    `, "async");
    console.log(result);
} catch (e) {
    console.log("Uncaught error:", e);
}
❯ qjs bar.mjs
Uncaught error: SyntaxError: expecting '('

This statement import * as os from "os"; causes this issue.

@Kreijstal
Copy link

esm is not es6

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