Repository: codesandbox/codesandbox-client (language: javascript)

Issue:
Sandboxes are crashed
<h1>💥 Crash Report</h1>

  <h2>What were you trying to accomplish when the crash occurred?</h2>

  > Please use this issue template to describe what you were doing when you encountered this crash. While we are able to fill in some details automatically, it's not always enough to reproduce!

  <h3>Link to sandbox: [link]() (optional)</h3>

  <h3>Crash Details</h3>

  <details>
  <summary>Environment</summary>

  | Browser |  Version  | Operating System | CodeSandbox Version |
  | ------- | --------- | ---------------- | ------------------- |
  | chrome | 117.0.0 | OS X 10.15.7           | 44beea6f0          |

  **Route:**
  https://codesandbox.io/s/inspiring-rubin-hlm94w

  **Error Code:**
4be18af309674bc1abcd3c5d5ae3f90a

  </details>

  <details>
  <summary>Error Message</summary>

  ```bash
  TypeError: Cannot read properties of undefined (reading 'id')
  TypeError: Cannot read properties of undefined (reading 'id')
    at Gt (https://codesandbox.io/static/js/default~app~embed.c067ea04c.chunk.js?_sw-precache=8e8afc51621b340121601b73fb037ad3:610:56960)
    at ua (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1858598)
    at xs (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1903680)
    at ml (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1889284)
    at hl (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1889209)
    at il (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1886557)
    at https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1844999
    at https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1919981
    at qo (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1844708)
    at $o (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1844944)
    at Yo (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1844879)
    at el (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1883346)
    at Object.enqueueSetState (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1849660)
    at t.setState (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:2102666)
    at https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1946889
    at r (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1019586)
    at https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1019816
    at Array.forEach (<anonymous>)
    at Object.notifyListeners (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1019786)
    at S (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1020983)
    at https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1022037
    at Object.confirmTransitionTo (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1019525)
    at Object.push (https://codesandbox.io/static/js/common.dc473cad4.chunk.js?_sw-precache=b57f0fad16bb516b9287e6a09dcfa6c0:1:1021817)
    at e.value (https://codesandbox.io/static/js/app.618b038a1.js?_sw-precache=dd91e66ee8bbb14c3b5575af1ab8a806:9:1185470)
    at https://codesandbox.io/static/js/app.618b038a1.js?_sw-precache=dd91e66ee8bbb14c3b5575af1ab8a806:9:1434698
    at c (https://codesandbox.io/static/js/vendors~app~embed~sandbox~sandbox-startup.7424373eb.chunk.js:1:4328)
    at Generator._invoke (https://codesandbox.io/static/js/vendors~app~embed~sandbox~sandbox-startup.7424373eb.chunk.js:1:4081)
    at forEach.t.<computed> [as next] (https://codesandbox.io/static/js/vendors~app~embed~sandbox~sandbox-startup.7424373eb.chunk.js:1:4685)
    at e (https://codesandbox.io/static/js/vendors~app~embed~sandbox~sandbox-startup.7424373eb.chunk.js:1:206)
    at a (https://codesandbox.io/static/js/vendors~app~embed~sandbox~sandbox-startup.7424373eb.chunk.js:1:417)
  
    in Gt
    in div
    in elements__Header
    in div
    in elements__Container
    in n
    in div
    in div
    in t
    in div
    in t
    in div
    in Ie
    in Xt
    in div
    in t
    in div
    in t
    in div
    in div
    in styled.div
    in div
    in elements__Container
    in Ie
    in Ty
    in Unknown
    in Unknown
    in t
    in t
    in div
    in elements__Content
    in n
    in withRouter(n)
    in div
    in elements__Container
    in Unknown
    in withRouter()
    in t
    in Unknown
    in Ie
    in c
    in t
  ```

  </details>
  


Discussion / hints:

Fix patch:
diff --git a/packages/app/src/app/components/Preview/DevTools/index.tsx b/packages/app/src/app/components/Preview/DevTools/index.tsx
index 4577c4f6573..8d56032104e 100644
--- a/packages/app/src/app/components/Preview/DevTools/index.tsx
+++ b/packages/app/src/app/components/Preview/DevTools/index.tsx
@@ -524,7 +524,7 @@ export class DevTools extends React.PureComponent<Props, State> {
           minHeight: 0,
         }}
       >
-        {!hideTabs && (
+        {!hideTabs && panes.length > 0 && (
           <Header
             onTouchStart={!primary ? this.handleTouchStart : undefined}
             onMouseDown={!primary ? this.handleMouseDown : undefined}


Test patch: