Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda