Skip to content

ClearScript can't run a javascript file generated by webpack #591

Discussion options

You must be logged in to vote

Hello @jikexiaojiang,

By default, ClearScript provides only a bare standard JavaScript environment. It does not provide Node.js or Web APIs. If your script code relies on those APIs, it won't run in ClearScript unless your host application provides them.

In this case, your script appears to be referencing self, which is part of the Web API. You could define self yourself before running the script – e.g., v8Engine.Execute("const self = globalThis"); – but if it relies on self, your script might rely on other Web APIs as well.

Good luck!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jikexiaojiang
Comment options

Answer selected by jikexiaojiang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants