stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.79k stars 145 forks source link

Error trying to run a PrimeNG Angular example. #1352

Closed mconner closed 6 months ago

mconner commented 7 months ago

Describe the bug

I'm trying to run an example (or my own fork, derived from it). of a PrimeNG angular component. The environment does not start up.

Link to the blitz that caused the error

https://stackblitz.com/edit/u37was?file=package.json

Steps to reproduce

  1. Go to https://primeng.org/splitter
  2. Click on the stackblitz link in the text
  3. The editor comes up, but it does not initialize. In the console, I get: u37was:1 The resource https://w-corp-staticblitz.com/fetch.worker.c9a8a620.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateasvalue and it is preloaded intentionally. u37was:1 The resource https://w-corp-staticblitz.com/webcontainer.c9a8a620.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriateas` value and it is preloaded intentionally. Navigated to https://stackblitz.com/edit/u37was?file=package.json w-corp-staticblitz.com/webcontainer.c9a8a620.js:1

    GET https://w-corp-staticblitz.com/webcontainer.c9a8a620.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 403 (Forbidden)

    u37was:44

    GET https://w-corp-staticblitz.com/fetch.worker.c9a8a620.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 403 (Forbidden)

    u37was:43

    GET https://w-corp-staticblitz.com/webcontainer.c9a8a620.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 403 (Forbidden)

    client-b86f844c5100a.js:2 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently e._parseColor @ client-b86f844c5100a.js:2 e.setTheme @ client-b86f844c5100a.js:2 t.open @ client-b86f844c5100a.js:2 e.open @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 da @ client-b86f844c5100a.js:2 Pc @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Ic @ client-b86f844c5100a.js:2 gc @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Jo @ client-b86f844c5100a.js:2 Qo @ client-b86f844c5100a.js:2 vc @ client-b86f844c5100a.js:2 notify @ client-b86f844c5100a.js:2 notifyNestedSubs @ client-b86f844c5100a.js:2 o @ client-b86f844c5100a.js:2 v @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 nrWrapper @ u37was?file=package.json:8 Promise.then (async) a.then @ u37was?file=package.json:8 componentDidMount @ client-b86f844c5100a.js:2 ha @ client-b86f844c5100a.js:2 Dc @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Ac @ client-b86f844c5100a.js:2 gc @ client-b86f844c5100a.js:2 dc @ client-b86f844c5100a.js:2 Jc @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 yc @ client-b86f844c5100a.js:2 il @ client-b86f844c5100a.js:2 t.render @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 t @ client-b86f844c5100a.js:2 nrWrapper @ u37was?file=package.json:8 u37was?file=package.json:8

    GET https://cdn.segment.com/analytics.js/v1/ta1kDK49qdEDEfd8KYxI37mW0GPkLKn1/analytics.min.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 (OK)

    nrWrapper @ u37was?file=package.json:8 analytics.load @ u37was?file=package.json:38 (anonymous) @ u37was?file=package.json:38 (anonymous) @ u37was?file=package.json:38 client-b86f844c5100a.js:2 Uncaught (in promise) TypeError: (0 , window.WebContainer) is not a constructor at $U (client-b86f844c5100a.js:2:2742042) at client-b86f844c5100a.js:2:3323282 at client-b86f844c5100a.js:2:3323492 at nrWrapper (u37was?file=package.json:8:16615) $U @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 nrWrapper @ u37was?file=package.json:8 Promise.then (async) a.then @ u37was?file=package.json:8 (anonymous) @ client-b86f844c5100a.js:2 da @ client-b86f844c5100a.js:2 ha @ client-b86f844c5100a.js:2 Dc @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Ac @ client-b86f844c5100a.js:2 gc @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Jo @ client-b86f844c5100a.js:2 Qo @ client-b86f844c5100a.js:2 vc @ client-b86f844c5100a.js:2 notify @ client-b86f844c5100a.js:2 notifyNestedSubs @ client-b86f844c5100a.js:2 o @ client-b86f844c5100a.js:2 v @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 nrWrapper @ u37was?file=package.json:8 Promise.then (async) a.then @ u37was?file=package.json:8 componentDidMount @ client-b86f844c5100a.js:2 ha @ client-b86f844c5100a.js:2 Dc @ client-b86f844c5100a.js:2 t.unstable_runWithPriority @ client-b86f844c5100a.js:2 Zo @ client-b86f844c5100a.js:2 Ac @ client-b86f844c5100a.js:2 gc @ client-b86f844c5100a.js:2 dc @ client-b86f844c5100a.js:2 Jc @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 yc @ client-b86f844c5100a.js:2 il @ client-b86f844c5100a.js:2 t.render @ client-b86f844c5100a.js:2 (anonymous) @ client-b86f844c5100a.js:2 t @ client-b86f844c5100a.js:2 nrWrapper @ u37was?file=package.json:8 jsonWorker.js:7 Fetch API cannot load stackblitz:/node_modules/%40angular/cli/lib/config/schema.json. URL scheme "stackblitz" is not supported.`

Expected behavior

The blitz should initialize and run.

Parity with Local

Screenshots

No response

Platform

Browser name  = Edge
Full version  = Version 122.0.2365.52 (Official build) (64-bit)
Major version = 122

Additional context

getting the same result in Chrome.

Nemikolh commented 7 months ago

Hey @mconner! Thanks for the report.

It might have been a temporary network failure? We haven't been able to reproduce it. Does it still happen to you?

If yes could you please send a screencast with the DevTools opened and the network tab selected?

mconner commented 7 months ago

Hey @mconner! Thanks for the report.

It might have been a temporary network failure? We haven't been able to reproduce it. Does it still happen to you?

If yes could you please send a screencast with the DevTools opened and the network tab selected?

This is still happening. This seems to be an issue with netskope (network security). I thought to try disabling it this morning (which I can do for now, but eventually not), then stackblitz works -- though I get some of the same errors, in either case.

Not sure If our IT has the netskope configuration too restrictive (they are still tweaking it, and I've put in a request to review it), or stackblitz is doing something it shouldn't.

mconner commented 7 months ago

@Nemikolh: The issue was with the url: https://w-credentialless-staticblitz.com/webcontainer.c9a8a620.js,
Our IT was able to put in a rule to allow it, so it is working, now.

Stackblitz had been working for me a few days prior, and it is unclear (to me, at least), if this was a change to StackBlitz or to our nework security.

Nemikolh commented 7 months ago

Oh it did got changed from w-credentialless.stacblitz.com to w-credentialless-stacblitz.com!

So that's why you needed changes on your side.

We did this because we want webcontainers to be isolated at the process level from one another for security reasons and so that they don't share memory limits. This was the first step to get there.

Thank you so much for getting back at us @mconner ! 🙏