Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda