fix: cors issues

fixed cors by adding coep headless line to the webcontainer
This commit is contained in:
Dustin Loring 2025-01-16 11:41:13 -05:00 committed by GitHub
commit f095d76593
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,11 @@ if (!import.meta.env.SSR) {
import.meta.hot?.data.webcontainer ?? import.meta.hot?.data.webcontainer ??
Promise.resolve() Promise.resolve()
.then(() => { .then(() => {
return WebContainer.boot({ workdirName: WORK_DIR_NAME }); return WebContainer.boot({
coep: 'credentialless',
workdirName: WORK_DIR_NAME,
forwardPreviewErrors: true, // Enable error forwarding from iframes
});
}) })
.then((webcontainer) => { .then((webcontainer) => {
webcontainerContext.loaded = true; webcontainerContext.loaded = true;