Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Storybook couldn't evaluate your .storybook/main.ts file #529

Closed
leosvelperez opened this issue Dec 20, 2024 · 0 comments
Closed
Labels
bug Something isn't working needs triage

Comments

@leosvelperez
Copy link

Describe the bug

With the new 0.21.0 version, an error is thrown when trying to process the main.ts file. See the logs below:

$ storybook dev -p 6006
@storybook/core v8.5.0-beta.3

SB_CORE-SERVER_0007 (MainFileEvaluationError): Storybook couldn't evaluate your .storybook/main.ts file.

Original error:
Error: Transform failed with 1 error:
(define name):1:0: ERROR: Expected identifier but found "import"
    at failureErrorWithLog (/node_modules/esbuild/lib/main.js:1466:15)
    at eval (/node_modules/esbuild/lib/main.js:745:50)
    at responseCallbacks.<computed> (/node_modules/esbuild/lib/main.js:612:9)
    at handleIncomingPacket (/node_modules/esbuild/lib/main.js:667:12)
    at Socket.readFromStdout (/node_modules/esbuild/lib/main.js:590:7)
    at Socket.emit (node:events:30:10899)
    at addChunk (node:internal/streams/readable:225:3685)
    at readableAddChunk (node:internal/streams/readable:225:3393)
    at Readable.push (node:internal/streams/readable:225:4971)
    at _0x50b08f.onStreamRead (node:internal/stream_base_commons:211:2596)
    at failureErrorWithLog (/node_modules/esbuild/lib/main.js:1466:15)
    at eval (/node_modules/esbuild/lib/main.js:745:50)
    at responseCallbacks.<computed> (/node_modules/esbuild/lib/main.js:612:9)
    at handleIncomingPacket (/node_modules/esbuild/lib/main.js:667:12)
    at Socket.readFromStdout (/node_modules/esbuild/lib/main.js:590:7)
    at Socket.emit (node:events:30:10899)
    at addChunk (node:internal/streams/readable:225:3685)
    at readableAddChunk (node:internal/streams/readable:225:3393)
    at Readable.push (node:internal/streams/readable:225:4971)
    at _0x50b08f.onStreamRead (node:internal/stream_base_commons:211:2596)
    at new StorybookError (./node_modules/@storybook/core/dist/server-errors.cjs:177:5)
    at new MainFileEvaluationError (./node_modules/@storybook/core/dist/server-errors.cjs:577:5)
    at loadMainConfig (./node_modules/@storybook/core/dist/common/index.cjs:17515:11)
    at async buildDevStandalone (./node_modules/@storybook/core/dist/core-server/index.cjs:37142:11)
    at async withTelemetry (./node_modules/@storybook/core/dist/core-server/index.cjs:35765:12)
    at async dev (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3)
    at async s.eval (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2643:74)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

To Reproduce

The default template with Next.js shows the problem: https://stackblitz.com/github/storybookjs/sandboxes/tree/next/nextjs/default-ts/after-storybook. Check the terminal.

System

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm <----- active
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-essentials: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/addon-interactions: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/addon-onboarding: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/blocks: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/nextjs: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/react: ^8.5.0-beta.3 => 8.5.0-beta.3 
    @storybook/test: ^8.5.0-beta.3 => 8.5.0-beta.3 
    storybook: ^8.5.0-beta.3 => 8.5.0-beta.3

Additional context

No response

@leosvelperez leosvelperez added bug Something isn't working needs triage labels Dec 20, 2024
@leosvelperez leosvelperez changed the title [Bug]: Storybook couldn't evaluate your .storybook/main.ts file in v0.21.0 [Bug]: Storybook couldn't evaluate your .storybook/main.ts file Dec 20, 2024
@leosvelperez leosvelperez closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant