getsentry / spotlight

Your Universal Debug Toolbar
https://spotlightjs.com
Other
386 stars 11 forks source link

Spotlight (1 & 2) is not compatible with Storybook 8 #419

Closed kensternberg-authentik closed 4 months ago

kensternberg-authentik commented 5 months ago

Environment

Storybook 8.1.6 w/Vite back-end Spotlight 1.2.17 & 2.0.0 Node 18.18.0

Steps to Reproduce

  1. Upgraded to Storybook 8 from Storybook 7.
  2. Attempted to build Storybook: storybook build

Expected Result

Storybook would build.

Actual Result

Build failed in 1.95s
=> Failed to build the preview
[commonjs--resolver] node_modules/@spotlightjs/overlay/dist/index-5682ce90.js (4962:29): Expected ',', got '='
file: ./node_modules/@spotlightjs/overlay/dist/index-5682ce90.js:4962:29

4960: }
4961: const q2 = w.lazy(() => import("./main-3257b7fc.js").then((n) => n.m));
4962: function Gp({
                   ^
4963:   data: n,
4964:   onUpdateData: a = () => {

RollupError: Expected ',', got '='

Looking through the source code, this location corresponds to:

export default function JsonViewer({
  data,
  onUpdateData = () => {},
  editingEnabled = false,
  clipboardEnabled = false,
  displayDataTypes = false,
  quotesOnKeys = false,
}: {

It appears that the default function being supplied here is not understood by whatever build tool is attempting to bundle the overlay into the storybook build.