I am currently developing a project with Laravel, InertisJS, Quasar, VueJS3 and have included Storybook here. I have worked out most of the basics so that it works as I had hoped. However, I currently have a problem for which I cannot find a solution.
// resources/js/Layouts/AuthenticatedLayout.stories.js
import AuthenticatedLayout from './AuthenticatedLayout.vue';
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction
export default {
component: AuthenticatedLayout,
tags: ['autodocs'],
argTypes: {
},
};
// More on writing stories with args: https://storybook.js.org/docs/vue/writing-stories/args
export const Default = {
args: {
},
};
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url'
// Added for importing quasar assets
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.js',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
// Added for loading quasar related things
quasar({sassVariables: 'resources/css/quasar-variables.sass'})
],
/***
* Workaround so path is set right for assets / See https://laracasts.com/discuss/channels/vit
e/laravel-vite-issue
***/
server: {
hmr: {
host: 'localhost',
},
},
resolve: {
alias: {
'@images': fileURLToPath(new URL('./resources/js/Images', import.meta.url))
}
}
});
My problem now is that when I start npm run storybook and then call the layout, I see in the developer console from the browser that the following files could not be loaded:
:6006/undefined/node_modules/@quasar/extras/roboto-font/web-font/KFOlCnqEu92Fr1MmEU9fBBc-.woff:1 GET http://localhost:6006/undefined/node_modules/@quasar/extras/roboto-font/web-font/KFOlCnqEu92Fr1MmEU9fBBc-.woff net::ERR_ABORTED 404 (Not Found)
:6006/undefined/node_modules/@quasar/extras/roboto-font/web-font/KFOmCnqEu92Fr1Mu4mxM.woff:1 GET http://localhost:6006/undefined/node_modules/@quasar/extras/roboto-font/web-font/KFOmCnqEu92Fr1Mu4mxM.woff net::ERR_ABORTED 404 (Not Found)
spotify.png:1 GET http://localhost:6006/undefined/resources/js/Images/spotify.png 404 (Not Found)
Image (async)
The interesting thing is: the layout itself works when I call npm run dev or npm run build. It also works when I call npm run build-storybook and then display the build via a web server. I.e. in the following three cases the assets are loaded correctly:
npm run dev
npm run build
npm run build-storybook
Not here:
npm run storybook
Currently, this does not seem logical to me. What is going wrong here? Seems like a bug to me
Link to Minimal Reproducible Example
No response
Participation
[ ] I am willing to submit a pull request for this issue.
What version of
vite
are you using?4.0.0
System info and storybook versions
System: OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish) CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz Binaries: Node: 18.16.0 - /usr/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 9.6.7 - /usr/bin/npm npmPackages: @storybook/addon-essentials: ^7.0.24 => 7.0.24 @storybook/addon-interactions: ^7.0.24 => 7.0.24 @storybook/addon-links: ^7.0.24 => 7.0.24 @storybook/blocks: ^7.0.24 => 7.0.24 @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2 @storybook/vue3: ^7.0.24 => 7.0.24 @storybook/vue3-vite: ^7.0.24 => 7.0.24
Describe the Bug
I am currently developing a project with Laravel, InertisJS, Quasar, VueJS3 and have included Storybook here. I have worked out most of the basics so that it works as I had hoped. However, I currently have a problem for which I cannot find a solution.
I have the following layout:
That's the story:
The
.storybook/main.js
The
.storybook/preview.js
The
vite.config.js
:My problem now is that when I start
npm run storybook
and then call the layout, I see in the developer console from the browser that the following files could not be loaded:The interesting thing is: the layout itself works when I call
npm run dev
ornpm run build
. It also works when I callnpm run build-storybook
and then display the build via a web server. I.e. in the following three cases the assets are loaded correctly:Not here:
Currently, this does not seem logical to me. What is going wrong here? Seems like a bug to me
Link to Minimal Reproducible Example
No response
Participation