Code generation from strings disallowed for this context


#1

Most js templating libraries rely on simple string2code evaluating to work. Is there any way to enable “unsafe-eval” for a specific worker?


#2

Unfortunately, there is not. For security and future-proofing we don’t allow eval-ing of code in Workers. You can however use templating engines which allow you to compile your template to Javascript ahead of time, and then include that Javascript in your Worker.