Unexpected errors everytime dynamic values are clicked in studio

In some of my projects, when I click on a dynamic value using code, I receive an error popup each time:

Unexpected error (X occurences)
Uncaught Error: Unexpected usage

Error: Unexpected usage
    at b.loadForeignModule (6810.4cd221c5.js:490:350046)
    at 6810.4cd221c5.js:476:49358
    at async 1575.92d78635.js:2:2600
    at async h.getLanguageServiceWorker (1575.92d78635.js:2:2690)
    at async S._doValidate (1575.92d78635.js:2:8186)
    at b.loadForeignModule (6810.4cd221c5.js:490:350046)
    at 6810.4cd221c5.js:476:49358
    at async 1575.92d78635.js:2:2600
    at async h.getLanguageServiceWorker (1575.92d78635.js:2:2690)
    at async S._doValidate (1575.92d78635.js:2:8186)
    at 6810.4cd221c5.js:453:173232
    at em (4506.ff03ce8f.js:465:1194678)

I’ve found that it happens regardless of the component (both on built-in Embed HTML props, and on custom component props)

Relevant links:

Hi, our code editor in studio uses Workers, but it seems that your custom host has a CSP that denies it as shown in the warning prior to the error in the image that you sent. You can include the following in your Content-Security-Policy:

worker-src blob: data: https: studio.plasmic.app;

To only allow Workers in Plasmic Studio, you should also be able to only include this header for your /plasmic-host page.

A bit of additional context: Content Security Policy (CSP) - HTTP | MDN.

1 Like

Yep, that was the issue - thanks for the help!