storybook icon indicating copy to clipboard operation
storybook copied to clipboard

Fresh install results in error

Open MaciejJezierskiFiskars opened this issue 11 months ago • 4 comments

Environment

  • Operating System: Darwin
  • Node Version: v23.6.0
  • Nuxt Version: 3.15.2
  • CLI Version: 3.20.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, modules
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-qzue1bhu?file=.storybook%2Fmain.ts

Describe the bug

@storybook/core v8.5.0

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

Original error: ReferenceError: require is not defined at getAbsolutePath (/.storybook/main.ts:10:18) at /.storybook/main.ts:15:5 at ModuleJobSync.runSync (node:internal/modules/esm/module_job:396:35) at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:363:47) at loadESMFromCJS (node:internal/modules/cjs/loader:1569:24) at Module._compile (node:internal/modules/cjs/loader:1721:5) at Object.loadTS [as .ts] (node:internal/modules/cjs/loader:1831:10) at Module.load (node:internal/modules/cjs/loader:1473:32) at Function._load (node:internal/modules/cjs/loader:1285:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at loadMainConfig (/Users/maciej.jezierski/projects/FiskarsGroup_CoreLibrary/node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/common/index.cjs:17550:11) at async buildDevStandalone (/Users/maciej.jezierski/projects/FiskarsGroup_CoreLibrary/node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:37127:11) at async withTelemetry (/Users/maciej.jezierski/projects/FiskarsGroup_CoreLibrary/node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/core-server/index.cjs:35750:12) at async dev (/Users/maciej.jezierski/projects/FiskarsGroup_CoreLibrary/node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3) at async s. (/Users/maciej.jezierski/projects/FiskarsGroup_CoreLibrary/node_modules/.pnpm/@[email protected][email protected]/node_modules/@storybook/core/dist/cli/bin/index.cjs:2643:74)

Additional context

All dependencies and proper configuration should be installed on fresh project

MaciejJezierskiFiskars avatar Jan 20 '25 09:01 MaciejJezierskiFiskars

Does this still occur with the latest storybook version?

tobiasdiez avatar Apr 07 '25 01:04 tobiasdiez

Yes, it does. I'm using Nuxt 3.17.2 and Storybook 8.16.2 and although the process tries to start for couple of seconds - it fails right away

Image

abogdanov-vfc avatar May 09 '25 09:05 abogdanov-vfc

Any update? i have the same issue

danielislas3 avatar Jun 03 '25 21:06 danielislas3

I can give some insights as well (using npm, Nuxt 3):

  1. When following the instructions (npx nuxi@latest module add storybook and updating nuxt.config.ts), I don't see any new directories (like .storybook) appear (install was successful).
  2. When adding that manually, including a config file, it can't find either @storybook/nuxt, or @nuxt/stroybook Also, apparently there's a video showing instructions, but I can't find it? (Zero configuration to start (see video))

Edit:

After digging through the repo, I see an example main.ts config file that actually works (why doesn't the module set this up? 🤔 )

But after running, there's issues with server imports (no idea why, I don't do server imports in the directory I have configured).

TheDutchCoder avatar Jul 31 '25 15:07 TheDutchCoder