Skip to content

Embbeded Webcontainer doesnt work #2100

Open
blackbaud/skyux
#4480

Description

@sevenzing

Describe the bug

Having this error in embedded project

Unable to run Embedded Project
Looks like this project is being embedded without proper isolation headers.

[Read more about browser support for embedded projects](https://developer.stackblitz.com/platform/webcontainers/browser-support#embedding)

We tried to add headers like credentialless of cross-origin isolation but it didnt work.

Issue also ocures locally

Link to the blitz that caused the error

https://ensnode.io/docs/integrate/integration-options/enskit/example

https://stackblitz.com/edit/w4ozjb2k?file=src%2FApp.tsx

Steps to reproduce

Simply go to url and see the error

Expected behavior

Previously we have this example worked fine

Parity with Local

Screenshots

Image

Platform

  • OS: macOS
  • Browser: Chrome, Brave
  • Version: "@stackblitz/sdk": "^1.11.0",

Additional context

No response

Activity

  1. mao-sz commented on May 27, 2026

    @mao-sz

    @SamVerschueren Unfortunately, adding corp=1 as a query param hasn't worked in my testing (running in Fedora 43, Chrome 148.0.7778.178):

    Image

    Same outcome whether or not I serve the top-level page with the two headers detailed in the comment above (confirmed the headers are present and correct).

  2. SamVerschueren commented on May 28, 2026

    @SamVerschueren
    Contributor

    @mao-sz do you happen to have a public URL you can share so I can take a look myself?

  3. mao-sz commented on May 28, 2026

    @mao-sz

    @SamVerschueren was testing in a larger codebase with more setup required so here's a minimum reproducible: https://github.com/mao-sz/stackblitz-embed-isolation-error

    Funnily enough, I just tested this in Firefox 151.0.1 and it works a treat, while Chrome, Chromium and Edge all still were unable to load the preview due to lacking proper isolation headers.

    In my use case, we're likely to go with a different solution without Stackblitz embeds in the end (came across this while trying to address a different problem and seeing if Stackblitz embeds would be the answer), but hopefully this might help others who do actually need them.

  4. SamVerschueren commented on May 28, 2026

    @SamVerschueren
    Contributor

    I found the reason. You need to allow cross origin isolation inside the iframe. I'll update my other post where I explain which headers to add.

    <iframe src="https://stackblitz.com/edit/vitejs-vite-dkn2k17m?embed=1&file=README.md&corp=1" allow="cross-origin-isolated" height="650" width="100%">
  5. mao-sz commented on May 28, 2026

    @mao-sz

    Ah, that makes sense, nice. Can confirm it works in my other testing. Hopefully this'll help the others who need this feature 👍

  6. sevenzing commented on Jun 1, 2026

    @sevenzing
    Author

    @SamVerschueren I failed to solve this issue using sdk

    here is the link to preview of my PR where I added crossOriginIsolated: true and 2 headers described above
    https://ensnodeio-git-ll-stackblitz-fix-issue-2100-namehash.vercel.app/docs/integrate/integration-options/enskit/example

    Image

    I also noted that in firefox this urls works fine! So it doesnt work in Chrome on my side.

    here is PR itself where I'm trying to fix the issue: https://github.com/namehash/ensnode/pull/2234/changes

  7. sevenzing commented on Jun 1, 2026

    @sevenzing
    Author

    @SamVerschueren I dug deeper with AI agent and probably found the root cause.

    The raw iframe approach with /edit/ works perfectly in Chrome, so If I use this iframe in our project it works perfect!

    <iframe src="https://stackblitz.com/edit/vitejs-vite-dkn2k17m?embed=1&file=README.md&corp=1" allow="cross-origin-isolated" height="650" width="100%">

    However, the SDK's embedProject() uses the /run endpoint instead of /edit/, and /run does not serve the same cross-origin isolation headers that /edit/ does when corp=1 is present.

    The /edit/ endpoint with corp=1 responds with:

    cross-origin-embedder-policy: require-corp
    cross-origin-opener-policy: same-origin
    cross-origin-resource-policy: cross-origin
    

    The /run endpoint (used by sdk.embedProject()) does not serve these headers, even with corp=1 in the URL. That's why crossOriginIsolated: true in the SDK doesn't work in Chromium — the iframe content itself isn't cross-origin isolated.

    Firefox is more lenient about propagating crossOriginIsolated into iframes with COEP: credentialless on the parent, which is why it works there but not in Chrome/Chromium/Edge.

  8. SamVerschueren commented on Jun 2, 2026

    @SamVerschueren
    Contributor

    @sevenzing It does look like the run request returns the correct headers, no?

    Image

    However, in the Application > Frames > run it does not show it as cross origin isolated 🤔 .

    Image

    Just to be sure, you are using the latest stackblitz sdk version? I believe it's 1.11.0?

  9. alexovn commented on Jun 13, 2026

    @alexovn

    @SamVerschueren I have same error. I tried to add corp=1 to the embed URL and allow="cross-origin-isolated" attribute to iframe, but nothing works. There's a problem with fetching https://json.schemastore.org/package and https://json.schemastore.org/prettierrc requests.

    <iframe style='width: 100%; height: 700px' src="https://stackblitz.com/edit/vitejs-vite-qhzy6i6j?embed=1&file=src%2FApp.vue&corp=1" allow="cross-origin-isolated"></iframe>
    Image
  10. sevenzing commented on Jun 17, 2026

    @sevenzing
    Author

    @SamVerschueren yes, I'm using latest 1.11.0

    Updates from my side:

    1. I dont see headers in response from /run/ endpoint, this is strange:
    Image
    1. Also sharing my Application > Frames > run
    Image
    1. In previous message I wrote that

    The raw iframe approach with /edit/ works perfectly in Chrome, so If I use this iframe in our project it works perfect!

    But now when I paste this iframe I also get Unable to run Embedded Project, mysterious

  11. sevenzing commented on Jun 25, 2026

    @sevenzing
    Author
  12. SamVerschueren commented on Jul 1, 2026

    @SamVerschueren
    Contributor

    @sevenzing I don't see the corp=1 flag in the run endpoint you are calling? Am I missing something here? I also don't see the query param in the requests made on https://ensnode.io/docs/integrate/integration-options/enskit/example.

    @alexovn The failures on schemastore is not something we can do, it's because schemastore.org doesn't serve the correct headers.

    Sorry about the inconvenience here. I'm juggling multiple things.

  13. SamVerschueren commented on Jul 1, 2026

    @SamVerschueren
    Contributor

    @sevenzing I think I found the root cause. I'll let you know when I released a new version of the SDK.

  14. SamVerschueren commented on Jul 2, 2026

    @SamVerschueren
    Contributor

    @sevenzing Can you update to the latest @stackblitz/sdk version 1.11.1 and test again?

  15. alexovn commented on Jul 2, 2026

    @alexovn

    @sevenzing I don't see the corp=1 flag in the run endpoint you are calling? Am I missing something here? I also don't see the query param in the requests made on https://ensnode.io/docs/integrate/integration-options/enskit/example.

    @alexovn The failures on schemastore is not something we can do, it's because schemastore.org doesn't serve the correct headers.

    Sorry about the inconvenience here. I'm juggling multiple things.

    Okay, I got it. But can we ignore schemastore.org? Otherwise, it looks like no example that has been embedded will work

  16. SamVerschueren commented on Jul 3, 2026

    @SamVerschueren
    Contributor

    Yes, I believe you can ignore it. I think they get loaded in order to get some code completion in package.json for known attributes. If they fail to load, you don't get auto completion, but that's fine. It does not prevent it from running.

  17. alexovn commented on Jul 3, 2026

    @alexovn

    Yes, I believe you can ignore it. I think they get loaded in order to get some code completion in package.json for known attributes. If they fail to load, you don't get auto completion, but that's fine. It does not prevent it from running.

    It's strange, 'cause I see that it may prevent loading a nested StackBlitz browser's example. I don't see any other purposes for this issue

  18. johnhwhite commented on Jul 14, 2026

    @johnhwhite

    We hit this issue when using the legacy, WebPack-based Angular dev-server in a webcontainer, and switching to the application builder also added the Cross-Origin-Resource-Policy header necessary to work in the webcontainer on StackBlitz.

    Our case was using openProject and not embedded projects, but adding the comment in case it helps others who encounter this issue.

  19. banzor commented on Sep 3, 2026

    @banzor

    We are experiencing this same issue. I tried adding the headers to our host page and adding the attributes to the iframe tag. Nothing is solving it.

    I have embedded a few different stackblitz samples in tutorials on our documentation site. Recently, they have become unable to render.

    See embed here:
    https://developer.mescius.com/spreadjs/docs/tutorials/how-to-import-and-export-excel-xlsx-using-javascript

    Sample here:
    https://stackblitz.com/edit/spreadjs-import-export-excel

    Error message:
    Unable to run Embedded Project
    Looks like this project is being embedded without proper isolation headers.

    Using iframe to embed. These have worked for a long time but broke suddenly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions