stackblitz / webcontainer-docs

WebContainer API Documentation
MIT License
71 stars 23 forks source link

[BUG] Can't run tutorial demo locally #4

Closed dgwyer closed 1 year ago

dgwyer commented 1 year ago

Describe the bug I'm working through the tutorial here: https://webcontainers.io/tutorial/1-building-your-first-webcontainers-app.

However, I can't get it to work due to the following console error message.

image

I've tried restarting the dev server, and hard-refreshing the browser several times.

To Reproduce Just follow the current tutorial steps.

Expected behavior Expected it to work the same as the final project.

Desktop (please complete the following information):

stackblitz[bot] commented 1 year ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

SamVerschueren commented 1 year ago

Hi @dgwyer. Have you read through the set up COOP/COEP headers section?

In order to use SharedArrayBuffer (which we heavily rely on), the page has to be cross origin isolated (like your error message indicates).

So make sure those headers are added to the dev server and it should work.

You can check this in Devtools as well

image
dgwyer commented 1 year ago

Update: It's resolved now. Was a misselling of a header. Thanks for the quick follow-up though!