Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wonderwhy-er committed Dec 24, 2024
1 parent 1cf1a81 commit 1670f16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/lib/webcontainer/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { WebContainer } from '@webcontainer/api';
import { workbenchStore } from '~/lib/stores/workbench';
import { WORK_DIR_NAME } from '~/utils/constants';

interface WebContainerContext {
Expand Down Expand Up @@ -28,9 +27,11 @@ if (!import.meta.env.SSR) {
forwardPreviewErrors: true, // Enable error forwarding from iframes
});
})
.then((webcontainer) => {
.then(async (webcontainer) => {
webcontainerContext.loaded = true;

const { workbenchStore } = await import('~/lib/stores/workbench');

// Listen for preview errors
webcontainer.on('preview-message', (message) => {
console.log('WebContainer preview message:', message);
Expand Down

0 comments on commit 1670f16

Please sign in to comment.