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

Vuetify 2.0.2 not supported #7593

Closed
jacklp opened this issue Jul 29, 2019 · 30 comments
Closed

Vuetify 2.0.2 not supported #7593

jacklp opened this issue Jul 29, 2019 · 30 comments

Comments

@jacklp
Copy link

jacklp commented Jul 29, 2019

Description:
https://stackoverflow.com/a/56367842
The new style of latest version of vuetify 2.0.2 requires that vuetify be passed into new Vue()

My .storybook/config.js file:

import Vue from 'vue'
import { configure, addDecorator } from '@storybook/vue';
import StoryRouter from 'storybook-vue-router'
import VueRouter from 'vue-router'

// add vuetify
import '../src/plugins/vuetify'

// add router
Vue.use(VueRouter)
addDecorator(StoryRouter())

// add vuetify
addDecorator(() => ({
      template: '<v-app><v-content><story/></v-content></v-app>',
}))

// add stories
function loadStories() {
  const req = require.context('../src/components/stories', true, /.stories.ts$/);
  req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);

My /plugins/vuetify.ts file:

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

export default new Vuetify({
	theme: {
		dark: true,
		icons: {
			iconfont: 'fa',
		},
		options: {
			customProperties: true,
		},
		themes: {
			dark: {
				blue: '#002579',
				'dark-grey': '#464646',
				green: '#00BE96',
				grey: '#EEE8E8',
				orange: '#FE5F5A',
				primary: '#FE5F5A',
				white: '#FFFFFF',
			},
		},
	},
})```



The problem:
Receiving a seemingly unrelated error:

Cannot read property 'dark' of undefined
TypeError: Cannot read property 'dark' of undefined
at VueComponent.isDark (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:73337:34)
at Watcher.get (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65400:25)
at Watcher.evaluate (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65505:21)
at VueComponent.computedGetter [as isDark] (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65755:17)
at VueComponent.themeClasses (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:105182:29)
at Watcher.get (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65400:25)
at Watcher.evaluate (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65505:21)
at Proxy.computedGetter (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:65755:17)
at Proxy.render (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:73354:15)
at VueComponent.Vue._render (http://localhost:9001/vendors~main.2f0c8252b2ad5480ce8f.bundle.js:64491:22)```

@atgjack
Copy link

atgjack commented Jul 29, 2019

I had the same issue. All you have to do is add vuetify to the addDecorator call.

// add vuetify
import vuetifyConfig from '../src/plugins/vuetify'

addDecorator(() => ({
      vuetify: vuetifyConfig,
      template: '<v-app><v-content><story/></v-content></v-app>',
}))

@jacklp
Copy link
Author

jacklp commented Jul 29, 2019

legend, thanks jack :)

@backbone87
Copy link
Contributor

Decorators are the correct approach.

@manuelmejiaio
Copy link

or if you don't want to import the plugin....

// add vuetify
const vuetifyConfig = new Vuetify({
	theme: {
		dark: false
	}
})

addDecorator(() => ({
      vuetify: vuetifyConfig,
      template: '<v-app><v-content><story/></v-content></v-app>',
}))


@morficus
Copy link

@jacklp - how did you add the VuetifyLoaderPlugin? via Webpack or vue.config.js?

@kyleoliveiro
Copy link

@morficus I was encountering the same issue as you. I solved it by creating a separate vuetify config file just for Storybook and using the full installation method for Vuetify inside of Storybook, so it doesn't rely on VuetifyLoaderPlugin.

This way I could get Vuetify working in Storybook while still using VuetifyLoaderPlugin in my main application. Hope that helps.

@adambuczek
Copy link

adambuczek commented Oct 30, 2019

I was actually able to make it work with A-la-carte setup. See revised config.js at the bottom.

@kyleoliveiro @atgjack
This setup doesn't work for me. Vue won't recognize custom Vuetify components.
[Vue warn]: Unknown custom element: <v-app>...
[Vue warn]: Unknown custom element: <v-card>...
And so on for every Vuetify component. It renders:

<v-app>
  <v-card height="400" width="256" class="mx-auto"></v-card>
</v-app>
  • vuetify: ^2.1.7
  • @storybook/vue: ^5.2.5

I configured Vuetify using Webpack install instructions and followed your advice configuring storybook with it's own plugin config.

My .storybook/webpack.config.js

const path = require('path');

module.exports = async ({ config, mode }) => {

    config.module.rules = [
        ...config.module.rules,
        {
        test: /\.s(c|a)ss$/,
        use: [
            'vue-style-loader',
            'css-loader',
            {
                loader: 'sass-loader',
                options: {
                        implementation: require('sass'),
                        sassOptions: {
                            fiber: require('fibers'),
                            indentedSyntax: true
                        }
                    }
                }
            ]
        }
    ];

    config.resolve.alias = {
        ...config.resolve.alias,
        '@': path.resolve(__dirname, '../src')
    }

    return config;
};

.storybook/config.js below

import Vue from 'vue'
import Vuetify from 'vuetify/lib'
import { configure, addDecorator } from '@storybook/vue'

Vue.use(Vuetify)

addDecorator(() => ({
    vuetify: new Vuetify(),
    template: '<v-app><story/></v-app>'
}))

configure(require.context('../stories', true, /\.stories\.js$/), module);

I don't know why v-components wont register globally but I got it to work by following A-la-carte setup to register them explicitly.
I import all from Vuetify, extract components only and register them all.

import Vue from 'vue'
import * as _Vuetify from 'vuetify/lib'
import { configure, addDecorator } from '@storybook/vue'

const Vuetify = _Vuetify.default

const isVueComponent = obj => obj.name === 'VueComponent'

const VComponents = Object.keys(_Vuetify).reduce((acc, key) => {
    if (isVueComponent(_Vuetify[key])) {
        acc[key] = _Vuetify[key]
    }
    return acc
}, {})

Vue.use(Vuetify, {
    components: {
        ...VComponents
    }
})

addDecorator(() => ({
    vuetify: new Vuetify(),
    template: '<v-app><story/></v-app>'
}))

configure(require.context('../stories', true, /\.stories\.js$/), module);

@antoniancu
Copy link

antoniancu commented Nov 8, 2019

I had the same problem and @adambuczek approach reflects mine. I do have an issue however in trying to override scss variable for Vuetify 2.

Currently, i have a variables.scss that's being imported into my main scss file.
Variable.scss contains Vuetify sass variable overrides like `$body-font-family: 'Quicksand-Regular'. However, when inspecting in storybook the applied font is still Roboto. What am i missing?

The above is incorrect, I was just redeclaring already declared sass variables. I now understand that i need VuetifyLoaderPlugin and the a-la-carte approach so that vuetifyloader can override the sass variables needed for customization.

When i do try the vuetifyloader approach, the it's my custom components that complain about not having a render function.

@kyleoliveiro
Copy link

@morficus I was encountering the same issue as you. I solved it by creating a separate vuetify config file just for Storybook and using the full installation method for Vuetify inside of Storybook, so it doesn't rely on VuetifyLoaderPlugin.

This way I could get Vuetify working in Storybook while still using VuetifyLoaderPlugin in my main application. Hope that helps.

This approach no longer works for Vuetify 2 since there is no more "Full installation method".

I'm having the same issue as @antoniancu; Unable to customize the Vuetify theme for Storybook.

The approach suggested by @atgjack does not work, as Storybook complains that the Vuetify components are not registered.

Please re-open this issue @backbone87

@martinmckenna
Copy link
Contributor

Having the same issue - can't customize anything Vuetify related.

Here's my config:

import Vue from 'vue'
import * as _Vuetify from 'vuetify/lib'
import { configure, addDecorator } from '@storybook/vue'
import { keyBy } from 'lodash';
import Icons from '@/components/icons/index';

const Vuetify = _Vuetify.default

const isVueComponent = obj => obj.name === 'VueComponent'

const VComponents = Object.keys(_Vuetify).reduce((acc, key) => {
    if (isVueComponent(_Vuetify[key])) {
        acc[key] = _Vuetify[key]
    }
    return acc
}, {})

Vue.use(Vuetify, {
    options: {
      customProperties: true,
    },
    icons: {
      iconfont: 'md',
      values: {
        ...keyBy(Icons, 'name'),
      },
    },
    components: {
        ...VComponents
    }
})

addDecorator(() => ({
    vuetify: new Vuetify({
      options: {
        customProperties: true,
      },
      icons: {
        iconfont: 'md',
        values: {
          ...keyBy(Icons, 'name'),
        },
      },
    }),
    template: '<v-app><story/></v-app>'
}))

// automatically import all files ending in *.stories.js
configure(require.context('../src', true, /\.stories\.js$/), module);

@martinmckenna
Copy link
Contributor

ok I got this working with the following config. Hoping this helps someone in the future. The difference between the sass and the scss rules are the semicolon at the end of the imported styles.scss file. One expects semicolons and one doesn't so combining them into 1 loader became impossible.

Frankly getting Storybook working with Vuetify is entirely too much trouble

const path = require('path');

module.exports = async ({ config }) => {

  function resolve(dir) {
    return path.join(__dirname, '..', dir);
  }

  /** removes existing scss rule */
  config.module.rules = config.module.rules.filter(rule =>
    !rule.test.test('.scss')
  )
  config.module.rules.push({
    test: /\.sass$/,
    use: [
      'vue-style-loader',
      'css-loader', {
        loader: 'sass-loader',
        options: {
          implementation: require('sass'),
          data: `
            @import '@/styles/styles.scss'
          `,
        }
      },
    ],
  }, {
    test: /\.scss$/,
    use: [
      'vue-style-loader',
      'css-loader', {
        loader: 'sass-loader',
        options: {
          implementation: require('sass'),
          data: `
            @import '@/styles/styles.scss';
          `,
        }
      },
    ],
  })

  config.resolve = {
    extensions: ['.js', '.vue', '.json'],
    alias: {
      vue$: 'vue/dist/vue.esm.js',
      '@': resolve('src'),
    },
  };

  return config;
}; 

@shilman
Copy link
Member

shilman commented Jan 4, 2020

cc @pocka @Aaron-Pool anything we learn from this and improve in the docs or out-of-box config?

@mediafreakch
Copy link

Here is how I got vuetify-loader to at least partially auto-import vuetify components.

storybook@5.3.3
vuetify-loader@1.4.3
vuetify@2.2.4
vue-cli-plugin-storybook@1.1.0

// vue.config.js
module.exports = {
  transpileDependencies: ["vuetify"],
  pluginOptions: {
    storybook: {
      allowedPlugins: ["VuetifyLoaderPlugin"]
    }
  }
};

Now if I use <v-btn> for example within a component that I import into a story, VBtn is automatically imported and registered by vuetify-loader. No warnings in the console and button looks fine visually.

However, if I use any vuetify component within a story definition itself, I get warnings about components that haven't registered. So if you are to use specific vuetify components within the story file, you have to manually register them:

// config/storybook/preview.js
import Vue from "vue";
import { addDecorator, configure } from "@storybook/vue";
import config from "../../src/plugins/vuetify";
import Vuetify, { VApp } from "vuetify/lib";

Vue.use(Vuetify, {
  components: {
    // Vuetify components used in stories need to be manually registered.
    // vuetify-loader cannot pick them up automatically. Presumably because how
    // storybook requires stories?!
    VApp,
  }
});

addDecorator(() => ({
  // 'config' includes the theme configuration (object) only
  vuetify: new Vuetify(config),
  render() {
    return (
      <v-app>
        <story />
      </v-app>
    );
  }
}));

configure(require.context("../../src", true, /\.stories\.js$/), module);

Maybe someone understands why this behaviour and how to make it easier?

@pksunkara
Copy link
Member

Yes, it is how storybook requires stories and how it interacts with Vue

@axdyng
Copy link

axdyng commented Jul 3, 2020

Yes, it is how storybook requires stories and how it interacts with Vue

can this be explained further? is there a documentation for me to read to understand this more?

@axdyng
Copy link

axdyng commented Jul 3, 2020

addDecorator(() => ({
// 'config' includes the theme configuration (object) only
vuetify: new Vuetify(config),
render() {
return (



);
}
}));

configure(require.context("../../src", true, /.stories.js$/), module);


Maybe someone understands why this behaviour and how to make it easier?

Hi @mediafreakch, could you explain what does the parameter vuetify within addDecorator() does? I couldn't find any docs that mentioned that property. Similarly, for configure() function.

I'm abit confused here as I'm not very familiar with storybook mechanics

@DomDomHaas
Copy link

DomDomHaas commented Jul 3, 2020

@morficus I was encountering the same issue as you. I solved it by creating a separate vuetify config file just for Storybook and using the full installation method for Vuetify inside of Storybook, so it doesn't rely on VuetifyLoaderPlugin.

This way I could get Vuetify working in Storybook while still using VuetifyLoaderPlugin in my main application. Hope that helps.

Thanks for that mate!

So I could globally load all vuetify components with:

// .storybook/vuetify_storybook.js
import Vue from 'vue';
import Vuetify from 'vuetify'; // loads all components
import 'vuetify/dist/vuetify.min.css'; // all the css for components
import config from '../src/plugins/vuetifyConfig'; // basic config with theme

Vue.use(Vuetify);

export default new Vuetify(config);

And in case someone is interested the whole configuration:

// .storybook/main.js
const path = require('path');

module.exports = {
  stories: ['../stories/**/*.stories.js'],
  addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-knobs'],

  webpackFinal: async (config, { configType }) => {

    // Use Sass loader for vuetify components
    config.module.rules.push({
      test: /\.s(a|c)ss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
      include: path.resolve(__dirname, '../'),
    });

    config.module.rules.push({
      resolve: {
        alias: {
          '@': path.resolve(__dirname, '../src'),
          vue: 'vue/dist/vue.js',
          'vue$': 'vue/dist/vue.esm.js',          
        },
      },
    });

    // Return the altered config
    return config;
  },
};
// .storybook/preview.js
import { addDecorator } from '@storybook/vue';
import vuetify from './vuetify_storybook';

addDecorator(() => ({
  vuetify,
  template: `
    <v-app>
      <v-main>
        <v-container fluid >
          <story/>
        </v-container>
      </v-main>
    </v-app>
    `,
}));

btw. version:

storybook: 5.3.19
vuetify: 2.3.3

@victorsilent
Copy link

Are you guys able to read scoped styles that touches vuetify components?
I'm trying it but with it doesn't work, just without scoped.
Example:

<style scoped lang="scss">
  .v-input--switch__thumb, .v-input--switch__track{
    background: var(--v-primary-base);
  }
</style>

@yog3sha
Copy link

yog3sha commented Nov 3, 2020

@morficus I was encountering the same issue as you. I solved it by creating a separate vuetify config file just for Storybook and using the full installation method for Vuetify inside of Storybook, so it doesn't rely on VuetifyLoaderPlugin.
This way I could get Vuetify working in Storybook while still using VuetifyLoaderPlugin in my main application. Hope that helps.

Thanks for that mate!

So I could globally load all vuetify components with:

// .storybook/vuetify_storybook.js
import Vue from 'vue';
import Vuetify from 'vuetify'; // loads all components
import 'vuetify/dist/vuetify.min.css'; // all the css for components
import config from '../src/plugins/vuetifyConfig'; // basic config with theme

Vue.use(Vuetify);

export default new Vuetify(config);

And in case someone is interested the whole configuration:

// .storybook/main.js
const path = require('path');

module.exports = {
  stories: ['../stories/**/*.stories.js'],
  addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-knobs'],

  webpackFinal: async (config, { configType }) => {

    // Use Sass loader for vuetify components
    config.module.rules.push({
      test: /\.s(a|c)ss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
      include: path.resolve(__dirname, '../'),
    });

    config.module.rules.push({
      resolve: {
        alias: {
          '@': path.resolve(__dirname, '../src'),
          vue: 'vue/dist/vue.js',
          'vue$': 'vue/dist/vue.esm.js',          
        },
      },
    });

    // Return the altered config
    return config;
  },
};
// .storybook/preview.js
import { addDecorator } from '@storybook/vue';
import vuetify from './vuetify_storybook';

addDecorator(() => ({
  vuetify,
  template: `
    <v-app>
      <v-main>
        <v-container fluid >
          <story/>
        </v-container>
      </v-main>
    </v-app>
    `,
}));

btw. version:

storybook: 5.3.19
vuetify: 2.3.3

This solution worked for me.
except that I had to import config in vuetify_storybook.js file from different path as

import config from '../../vue.config';

Thanks a lot @DomDomHaas !

@stingpan
Copy link

Thank you @DomDomHaas, your set up also worked for me.
I still did run into an issue when creating stories using Vuetify VSelect component. Those of you using @storybook/addon-essentials might encounter the same thing.

Specifically this is what I saw in the Chrome browser console:

TypeError: Cannot read property 't' of undefined
    at VueComponent.listData (vuetify.js:22647)
    at Watcher.get (vue.esm.js:4488)
    at Watcher.evaluate (vue.esm.js:4593)
    at VueComponent.computedGetter [as listData] (vue.esm.js:4845)
    at VueComponent.staticList (vuetify.js:22663)
    at Watcher.get (vue.esm.js:4488)
    at Watcher.evaluate (vue.esm.js:4593)
    at VueComponent.computedGetter [as staticList] (vue.esm.js:4845)
    at VueComponent.genList (vuetify.js:22896)
    at VueComponent.genMenu (vuetify.js:22944)

...

index.js:60 TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.
    at Object.inserted (vuetify.js:32620)
    at VueComponent.mounted (vuetify.js:37737)
    at invokeWithErrorHandling (vue.esm.js:1863)
    at callHook (vue.esm.js:4228)
    at Object.insert (vue.esm.js:3148)
    at invokeInsertHook (vue.esm.js:6357)
    at Vue.patch [as __patch__] (vue.esm.js:6576)
    at Vue._update (vue.esm.js:3954)
    at Vue.updateComponent (vue.esm.js:4075)
    at Watcher.get (vue.esm.js:4488)

From process of elimination, I narrowed it down to something to do with Storybook's Docs add-on that comes from including @storybook/addon-essentials in main.js. I wasn't using the Docs add-on anyway so I've disabled it to fix this issue:

module.exports = {
  stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
  addons: [
    "@storybook/addon-links",
    {
      name: "@storybook/addon-essentials",
      options: {
        docs: false
      }
    }
  ]
...

@thomasvogelaar
Copy link

Thank you @DomDomHaas, your set up also worked for me.
I still did run into an issue when creating stories using Vuetify VSelect component. Those of you using @storybook/addon-essentials might encounter the same thing.

Specifically this is what I saw in the Chrome browser console:

TypeError: Cannot read property 't' of undefined
    at VueComponent.listData (vuetify.js:22647)
    at Watcher.get (vue.esm.js:4488)
    at Watcher.evaluate (vue.esm.js:4593)
    at VueComponent.computedGetter [as listData] (vue.esm.js:4845)
    at VueComponent.staticList (vuetify.js:22663)
    at Watcher.get (vue.esm.js:4488)
    at Watcher.evaluate (vue.esm.js:4593)
    at VueComponent.computedGetter [as staticList] (vue.esm.js:4845)
    at VueComponent.genList (vuetify.js:22896)
    at VueComponent.genMenu (vuetify.js:22944)

...

index.js:60 TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.
    at Object.inserted (vuetify.js:32620)
    at VueComponent.mounted (vuetify.js:37737)
    at invokeWithErrorHandling (vue.esm.js:1863)
    at callHook (vue.esm.js:4228)
    at Object.insert (vue.esm.js:3148)
    at invokeInsertHook (vue.esm.js:6357)
    at Vue.patch [as __patch__] (vue.esm.js:6576)
    at Vue._update (vue.esm.js:3954)
    at Vue.updateComponent (vue.esm.js:4075)
    at Watcher.get (vue.esm.js:4488)

From process of elimination, I narrowed it down to something to do with Storybook's Docs add-on that comes from including @storybook/addon-essentials in main.js. I wasn't using the Docs add-on anyway so I've disabled it to fix this issue:

module.exports = {
  stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
  addons: [
    "@storybook/addon-links",
    {
      name: "@storybook/addon-essentials",
      options: {
        docs: false
      }
    }
  ]
...

I tried to dig further into this with no success. When the docs addon is enabled, this.$vuetify just seems to be a circular reference to Vue?

@may17
Copy link

may17 commented Jan 7, 2021

Imho this issue should be reopened. I`ve got the same problem as @thomasvogelaar and @stingpan. Only after disabling the docs everything works as expected. Any ideas anyone?

@github-actions
Copy link
Contributor

Automention: Hey @Aaron-Pool @elevatebart @pocka, you've been tagged! Can you give a hand here?

@LeBenLeBen
Copy link
Contributor

There’s indeed an issue with this, when you provide vuetify object globally through a decorator, it works once (its defined the first time it goes through the function), but then the object is modified somehow and keys such as $vuetify.lang aren’t available anymore.

I was able to work around the issue by providing the vuetify object again locally to the component.

vuetify.js

import Vue from 'vue';
import Vuetify from 'vuetify/lib';

Vue.use(Vuetify);

const vuetify = new Vuetify({
  // ...
});

export default vuetify;

.storybook/preview.js

import vuetify from './path/to/vuetify.js';

addDecorator(() => ({
  vuetify,
  components: {
    VApp,
  },
  render() {
    return (
      <VApp>
          <story />
      </VApp>
    );
  },
}));

whatever.stories.mdx

export const Template = (args, { argTypes }) => ({
  vuetify, // <- Provide vuetify again locally
  props: Object.keys(argTypes),
  components: { VSelect },
  template: `<VSelect :label="label" v-model="value" :items="items" />`,
});

@pocka
Copy link
Contributor

pocka commented Mar 5, 2021

IMO this issue should focus on the original topic (we can't access Vue root instance, the workaround is to add a decorator) and we better create another issue with more specific contexts. It seems recent comments are Docs Addon specific (especially Dynamic Source Rendering is suspicious regarding dates...). It's so hard to work on a bug report in the issue for a different bug, not only insufficient information (issue template is important!) but also the difficulty of knowing what "this issue" or "this bug" indicates.

@LeBenLeBen
Copy link
Contributor

@pocka Isn’t the decorator needed in any case? The components must be wrapped within a VApp element for the styling to be applied properly. Also passing the Vuetify instance to the root Vue component is also needed according to Vuetify docs, Vue.use() is not enough, see Webpack install.

@pocka
Copy link
Contributor

pocka commented Mar 8, 2021

@LeBenLeBen

Isn’t the decorator needed in any case? The components must be wrapped within a VApp element for the styling to be applied properly.

Ah, my bad. We can't eliminate the need for the decorator anyway. Also, the correct problem is "we can't access Vue root instance" not "we can't Vue.use" (updated original comment).

Also passing the Vuetify instance to the root Vue component is also needed according to Vuetify docs, Vue.use() is not enough, see Webpack install.

Do you mean this? It seems it's working without it according to comments... I thought the vuetify injection on the decorator is for this 🤔

new Vue({
  vuetify,
}).$mount('#app')

I (and some contributors) acknowledge the root instance problem but there seems no actions taken yet.

Relavant one: #13862

What I said is the "vuetify does not work when Docs Addon enabled". This is clearly Docs Addon, especially its rendering/source generation mechanisms' problem, since the same user code working on Canvas (normal preview). Docs Addon too have the root instance problem but we shouldn't mix these so to make these easier to work on.

@desiboli
Copy link

Hi just wanna say that I'm experiencing the same problem mentioned in some comments here regards importing the global variables.scss file. Has anyone found a solution or a workaround for this ? 🙏

I've tried with both importing import '!style-loader!css-loader!sass-loader!../src/styles/variables.scss'; and import "@/styles/variables.scss";with no success :(

This is my .storybook/preview.js file:

import Vuetify from 'vuetify';
import vuetifyOptions from "../vuetify.options";
import 'vuetify/dist/vuetify.min.css'
// import "@/styles/variables.scss";
import '!style-loader!css-loader!sass-loader!../src/styles/variables.scss';
import { addDecorator } from '@storybook/vue';

Vue.use(Vuetify);

addDecorator(() => ({
  vuetify: new Vuetify(vuetifyOptions),
  template: `
    <v-app>
      <v-main>
        <v-container fluid>
          <story/>
        </v-container>
      </v-main>
    </v-app>
    `
}));

export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" }
}

@ndelangen
Copy link
Member

Is this issue still relevant today in 7.0 beta?

@valentinpalkovic
Copy link
Contributor

I am closing this since we haven't had any reaction for a year. Please let us know if the issue persists in the latest version of Storybook.

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

No branches or pull requests