storybook-nuxt
storybook-nuxt copied to clipboard
Errors for globals nuxt components
Transform failed with 2 errors: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-button/v-button.vue:126:6: ERROR: The symbol "_hoisted_1" has already been declared /Users/a1/work-projects/popso/components/global/v-button/v-button.vue:168:7: ERROR: Multiple exports with the same name "default"
ERROR Transform failed with 1 error: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-content-container/v-content-container.vue:56:7: ERROR: Multiple exports with the same name "default"
ERROR Transform failed with 2 errors: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-icon/v-icon.vue:48:6: ERROR: The symbol "_hoisted_1" has already been declared /Users/a1/work-projects/popso/components/global/v-icon/v-icon.vue:71:7: ERROR: Multiple exports with the same name "default"
ERROR Transform failed with 2 errors: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-page-container/v-page-container.vue:58:6: ERROR: The symbol "_hoisted_1" has already been declared /Users/a1/work-projects/popso/components/global/v-page-container/v-page-container.vue:93:7: ERROR: Multiple exports with the same name "default"
ERROR Transform failed with 1 error: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-text/v-text.vue:148:7: ERROR: Multiple exports with the same name "default"
ERROR Transform failed with 2 errors: 9:20:19 PM /Users/a1/work-projects/popso/components/global/v-tooltip/v-tooltip.vue:157:6: ERROR: The symbol "_hoisted_1" has already been declared /Users/a1/work-projects/popso/components/global/v-tooltip/v-tooltip.vue:208:7: ERROR: Multiple exports with the same name "default"
And every component that imports a global component does not work, here is such an error:
runtime.js:4 TypeError: Failed to fetch dynamically imported module: http://localhost:6006/components/ui-kit/v-error-sutb/v-error-stub.stories.js
main.js config for storybook
import { mergeConfig } from 'vite'
import userConfig from './vite.config';
module.exports = {
stories: [
'../components/**/*.docs.mdx',
'../components/**/*.stories.@(js|ts)',
'../pages/**/*.stories.@(js|ts)'
],
addons: [
'@storybook/addon-essentials',
'storybook-addon-nuxt'
],
framework: {
name: '@storybook-vue/nuxt',
options: {}
},
docs: {
autodocs: 'tag'
},
async viteFinal(baseConfig) {
return mergeConfig(baseConfig, userConfig);
}
};
vite config(userConfig)
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
alias: {
'~': fileURLToPath(new URL('../', import.meta.url)),
'@': fileURLToPath(new URL('../', import.meta.url)),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "@/assets/styles/variables/colors.scss";
@import "@/assets/styles/variables/media.scss";
@import "@/assets/styles/mixins/layouts.scss";
@import "@/assets/styles/mixins/media.scss";
@import "@/assets/styles/mixins/typography.scss";
@import "@/assets/styles/mixins/helpers.scss";
`
}
}
}
});
And for every global component i have error:
Internal server error: At least one or
Think this is related: https://github.com/storybook-vue/storybook-nuxt/issues/4
Duplicate of https://github.com/storybook-vue/storybook-nuxt/issues/4.