vue3-popper
vue3-popper copied to clipboard
Content Security Policy Header Errors
Description of the bug A clear and concise description of what the bug is.
- Rollup build generates only a JS file that dynamically injects inline CSS into our app. This cause a problem with our app's Content Security Policy headers
Reproduction link If you can, create a reproduction on CodeSandbox
// In file vue3-popper/dist/popper.ssr.js
function render(_ctx, _cache) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1);
}function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (!css || typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
- Rollup build generates a CSS and JS file so the app has the ability to use the CSS without inline injecting CSS through JS.
Screenshots
If applicable, add screenshots to help explain your problem.

Hi, I have the same bug.
Is there any workaround to this problem?
thanks
Is there any solution to this?