stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.19k stars 886 forks source link

Infinity loop #2769

Open tamtakoe opened 9 months ago

tamtakoe commented 9 months ago

https://stackblitz.com/edit/stackblitz-starters-b37cw2?file=src%2Findex.html

fvsch commented 9 months ago

Seeing this error in devtools:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substring')
    at s (webcontainer.a8c70b9797689ab630bc39693935365c46b0aa9d.js:8:66054)
    at webcontainer.a8c70b9797689ab630bc39693935365c46b0aa9d.js:8:224205
    at Array.map (<anonymous>)
    at Nt.collectErrors (webcontainer.a8c70b9797689ab630bc39693935365c46b0aa9d.js:8:224187)
    at webcontainer.a8c70b9797689ab630bc39693935365c46b0aa9d.js:8:182692
drew-codes commented 1 week ago

Good morning! Any update on this issue? I've run into the same issue while trying to embed this github project into one of my blog posts.

It's a pretty straightforward react component that I am using to embed the project:

'use client'
import { useRef, useEffect } from 'react'
import sdk from '@stackblitz/sdk'

const EMBED_CONTAINER_ID = 'stackblitz-embed-container'

export const StackblitzEmbed = ({ projectId }) => {
  useEffect(() => {
    sdk.embedGithubProject(EMBED_CONTAINER_ID, 'drew-codes/angular-snax', {
      height: 500,
      openFile: ['projects/deferrable-views-demo/src/app/app.component.html'],
      view: 'preview',
      clickToLoad: true,
    })
  }, [])

  return <div id={EMBED_CONTAINER_ID} />
}