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

Decorators do not work #808

Open
g1ronn1mo opened this issue Oct 25, 2024 · 1 comment · May be fixed by #823
Open

Decorators do not work #808

g1ronn1mo opened this issue Oct 25, 2024 · 1 comment · May be fixed by #823
Labels
type: bug Something isn't working

Comments

@g1ronn1mo
Copy link

Environment


  • Operating System: Linux
  • Node Version: v22.9.0
  • Nuxt Version: 3.13.2
  • CLI Version: 3.14.0
  • Nitro Version: 2.9.7
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

...

Describe the bug

Can not integrate decorators.

import ListSpaces from './ListTestVocabulary.vue';
import type { Meta, StoryObj } from '@storybook/vue3'

const meta = {
  title: "Test/ListTestVocabulary",
  component: ListSpaces,
  decorators: [() => ({ template: '<div style="margin: 3em;"><story/></div>' })],

}  satisfies Meta<typeof ListSpaces>

type Story = StoryObj<typeof meta>

export default meta

export const Default: Story = {
  args: {

  },

}  
 

The story does not render and throws:

[Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js". 
  at <Anonymous> 
  at <App>

Additional context

No response

@g1ronn1mo g1ronn1mo added the type: bug Something isn't working label Oct 25, 2024
@Vanessi-K
Copy link

A workaround to use decorators at the moment, that worked for me, would be to add the following to .storybook/main.js.

import { mergeConfig } from 'vite';

const config = {
  async viteFinal(config) {
    return mergeConfig(config, {
      resolve: {
        alias: {
          vue: 'vue/dist/vue.esm-bundler'
        }
      },
    });
  }
};
export default config;

This of course is not the ideal solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
2 participants