Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Storybook-server with local files

I'm trying to run a @storybook-server instance that fetches HTML files from a local directory, instead of a running server.

By documentation the HTML files (with respective paths) should come from a remote - or local - server, as below

export const parameters = {
  server: {
    url: `http://localhost:${port}/storybook_preview`,
  },
};

However, since my HTML is SSG I would like to have a way to run the storybook against a local directory containing my files, without having to run a separate node server just to serve these static files.

I have a test.html file on my src folder, and its respective story pointing to its filename

{
  "title": "Example/test",
  "parameters": {
    "server": { "id": "test.html" }
  },
  "stories": [
    {
      "name": "Main"
    }
  ]
}

I tried with

export const parameters = {
  server: {
    url: 'file://' + path.resolve('src'),
  },
};

but that, unfortunately, generated an error on the storybook stating

Failed to fetch
TypeError: Failed to fetch
    at _callee$ (http://localhost:6006/vendors~main.iframe.bundle.js:9510:20)
    at tryCatch (http://localhost:6006/vendors~main.iframe.bundle.js:46534:40)
    at Generator.invoke [as _invoke] (http://localhost:6006/vendors~main.iframe.bundle.js:46765:22)
    at Generator.next (http://localhost:6006/vendors~main.iframe.bundle.js:46590:21)
    at asyncGeneratorStep (http://localhost:6006/vendors~main.iframe.bundle.js:9472:103)
    at _next (http://localhost:6006/vendors~main.iframe.bundle.js:9474:194)
    at http://localhost:6006/vendors~main.iframe.bundle.js:9474:364
    at new Promise (<anonymous>)
    at http://localhost:6006/vendors~main.iframe.bundle.js:9474:97
    at defaultFetchStoryHtml (http://localhost:6006/vendors~main.iframe.bundle.js:9525:17)

Any suggestion would be highly appreciated!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For those who might find themselves in the same situation:

I got rid of @storybook/server and opted for @storybook/html, which was more suitable to my case

https://storybook.js.org/docs/html/get-started/introduction

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!