sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Nullish coalescing breaks Sandpack

Open iampava opened this issue 10 months ago • 0 comments

Bug report

Packages affected

  • [x] sandpack-client
  • [ ] sandpack-react

Description of the problem

Using the nullish coalescing feature breaks the preview.

Example from the official website: image

What were you doing when the problem occurred?

What steps can we take to reproduce the problem?

Navigate to https://sandpack.codesandbox.io/docs/getting-started/usage#templates.

Choose the vanilla template and write this code

import "./styles.css";

let text;
document.getElementById("app").innerHTML = text ?? "smth";

See how an error appears (visible in the picture as well)

iampava avatar Aug 31 '23 11:08 iampava