How to enable strict CSP in Vaadin Flow

This topic is the discussion thread for the Vaadin documentation page How to enable strict CSP in Vaadin Flow.

Questions, feedback, and comments are welcome here.

Hello,

after deep analysis I found out that chunk loading was not properly working.

I fixed the faulty lines with:

if (key.startsWith("return window.Vaadin.Flow.loadOnDemand(")) {
    const chunk = key.split("return window.Vaadin.Flow.loadOnDemand('").pop().split("');").shift();
    return function () { return window.Vaadin.Flow.loadOnDemand(chunk);};
}