With a CSP header of:
content-security-policy:base-uri 'self'; default-src 'self'; font-src 'self' data:; img-src 'self' https://secure.gravatar.com data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-src 'self' https://www.youtube.com https://docs.google.com;
I see an error in the Chrome console like below on the post/page editing pages in the WordPress Admin

And the Yoast SEO box on the post/page editor not working like below

If I add unsafe-eval to the script-src directive in my CSP, however, the error above does not appear and the Yoast SEO box works as expected.
I expect to be able to use Yoast SEO without the script-src 'unsafe-eval' directive in my CSP for security.
See above. I would expect it to be reproducible on a base WordPress install served with a CSP header similar to above.
I have looked into this and determined that the cause it located here:
https://github.com/Yoast/wordpress-seo/blob/trunk/webpack/webpack.config.default.js#L9
Trying to disable it triggers several different other errors and problems.
@Xyfi / @IreneStr could you take a look at this?
After some research, I figured out the exception is triggered by a third party library. The lodash function template is not CSP safe: https://lodash.com/docs/4.17.4#template, and is used by the WordPress core libraries.
@collinbarrett The error also occurs when Yoast SEO is disabled. Some functions of the editor stop working, so I don't think using the editor without unsafe-eval directive is really an option.
Because this is an issue in WordPress core I'm closing this issue.
I understand, thanks for looking into it, @Xyfi .
@collinbarrett Here you can read up on what the Wordpress Development team has to say about unsafe-eval: https://core.trac.wordpress.org/ticket/38695.
Was adding that to my todo list right as you posted that comment. Thanks for that link, saved me a lot of searching. Will do! I only saw the issue evidenced with Yoast, but I see it is a larger WordPress issue that needs to be resolved.
Thanks again.
Or via the more general search query: https://core.trac.wordpress.org/search?q=Content-Security-Policy
A lot of these issues have been closed already though.