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

Use storybook's buildDevStandalone to start dev server #1

Open
tobiasdiez opened this issue Sep 29, 2023 · 4 comments
Open

Use storybook's buildDevStandalone to start dev server #1

tobiasdiez opened this issue Sep 29, 2023 · 4 comments

Comments

@tobiasdiez
Copy link

Currently the module uses the storybook cli to start the dev server in a new process. I think its more flexible and convenient to use storybooks buildDevStandalone for this. You can have a look at https://github.com/JabRef/JabRefOnline/blob/main/modules/storybook.ts on how this can be done.

@ineshbose
Copy link

Similar usage: nuxt-modules/tailwindcss#793 (comment)

@lud-hu
Copy link

lud-hu commented Feb 3, 2024

Hi @tobiasdiez ,

since none of the available storybook modules seem to work properly I tried to get your solution up and running but I'm running into this error:

 ERROR  EISDIR: illegal operation on a directory, read                                                                                                                      8:49:45 AM

  at Object.readSync (node:fs:744:3)
  at tryReadSync (node:fs:444:20)
  at readFileSync (node:fs:490:19)
  at jiti (node_modules/jiti/dist/jiti.js:1:254438)
  at node_modules/@storybook/core-server/dist/index.js:51:2268
  at async getPreviewBuilder (node_modules/@storybook/core-server/dist/index.js:51:2172)
  at async Promise.all (index 0)
  at async buildDevStandalone (node_modules/@storybook/core-server/dist/index.js:119:2418)
  at async startStorybookServer (modules/storybook.ts:22:10)
  at async modules/storybook.ts:88:31

Do you have an idea what the problem might be? I cannot manage to debug it... :(

@tobiasdiez
Copy link
Author

@lud-hu
Copy link

lud-hu commented Feb 3, 2024

Thanks @tobiasdiez !
I really don't know why, but after switching over from

framework: {
    name: '@storybook/vue3-vite',
    options: {},
  },

to

framework: {
    name: '@storybook/nuxt',
    options: {},
  },

solved this particular issue.

Now I at least get the story rendered but it seems like there is no styling applied and e.g. <NuxtIcon /> is not rendered as well. Is there anything more to take into account in your solution then:

  • Adding pages/_storybook/external-iframe.vue
  • Adding modules/storybook.ts
  • Installing storybook-vue-addon and registering it as nuxt module
  • Add a story as e.g. Button.stories.vue and register it in pages/_storybook/external-iframe.vue

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants