NuxtN
Nuxt16mo ago
deangib89

Component provided template option but runtime compilation is not supported in this build of Vue

I'm getting this runtime error in the browser when I run Storybook. The error specifically only happens for this story:

import Label from './Label.vue'

export default {
  title: 'Atoms/Label',
  component: Label,
  tags: ['autodocs'],
  parameters: {
    layout: 'centered',
  },
}

// This fails because of the `template` key
export const Default = () => ({
  components: { Label },
  template: '<Label>Hello world!</Label>', 
})

// Stories like this work fine
// But I have no way of passing in `<slot/>`s
export const Default: Story = {
  args: {
    someProp: 'xxx'
  },
}


This is my ./storybook/main.ts:

import type { StorybookConfig } from '@storybook-vue/nuxt'

const config: StorybookConfig = {
  stories: ['../components/**/*.story.ts'],
  addons: ['@storybook/addon-essentials'],
  framework: {
    name: '@storybook-vue/nuxt',
    options: {},
  },
  docs: {
    autodocs: 'tag',
  },
}
export default config


The full error in browser:

runtime.js:8247 [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 <Anonymous> 
  at <App>
Was this page helpful?