Skip to content

Storybook doesn't run #1173

Description

@adamerose

I cloned the repo and ran npm install -> npm run storybook but get the error below on both the latest commit and the 6.0.3 release. Am I doing something wrong? I was surprised to see no existing issue for this since anyone trying to run the project should get the same error.

[0] storybook v9.1.2
[0] Using CommonJS in your main configuration file is deprecated with Vite.
[0] info => Starting manager..
[0] info => Starting preview..
[0] Re-optimizing dependencies because vite config has changed
[0] Error:    Failed to scan for dependencies from entries:
[... long list of .stories.tsx files snipped ...]
[0]
[0]   X [ERROR] Failed to resolve entry for package "@glideapps/glide-data-grid". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]
[0]
[0]      node_modules/vite/node_modules/esbuild/lib/main.js:1225:21:
[0]        1225 │          let result = await callback({
[0]             ╵                               ^
[0]
[0]      at packageEntryFailure (file:///C:/_MyFiles/Programming/Projects/_repos/glide-data-grid/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:46638:15)
[0]      at resolvePackageEntry (file:///C:/_MyFiles/Programming/Projects/_repos/glide-data-grid/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:46635:3)
[0]      at tryNodeResolve (file:///C:/_MyFiles/Programming/Projects/_repos/glide-data-grid/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:46451:16)
[0]      at ResolveIdContext.resolveId (file:///C:/_MyFiles/Programming/Projects/_repos/glide-data-grid/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:46201:19)        
[0]      at PluginContainer.resolveId (file:///C:/_MyFiles/Programming/Projects/_repos/glide-data-grid/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:49018:17)        
[0]      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
[0]
[0]    The plugin "vite:dep-scan" was triggered by this import
[0]
[0]      packages/cells/src/cell.stories.tsx:3:63:
[0]        3 │ ... DataEditorProps, GridCellKind } from "@glideapps/glide-data-grid";
[0]          ╵                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The fix seems to be adding this to .storybook/main.cjs

            resolve: {
                alias: {
                    "@glideapps/glide-data-grid": join(__dirname, "../packages/core/src/index.ts"),
                    "@glideapps/glide-data-grid-source": join(__dirname, "../packages/source/src/index.ts"),
                    "@glideapps/glide-data-grid-cells": join(__dirname, "../packages/cells/src/index.ts"),
                },
            },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions