Skip to content

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

@kensternberg-authentik

Description

@kensternberg-authentik

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:

  • ./spotlight/packages/overlay/src/integrations/sentry/components/developerInfo/JsonViewer.tsx:[4-9]
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.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions