ClearScript can't run a javascript file generated by webpack #591
-
Hello, I'm trying to run javascript within ClearScript. The details are below:
here is the test code that try to invoke js
So is there any guide that tells how to run js file generated by webpack? thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 Good luck! |
Beta Was this translation helpful? Give feedback.
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 defineself
yourself before running the script – e.g.,v8Engine.Execute("const self = globalThis");
– but if it relies onself
, your script might rely on other Web APIs as well.Good luck!