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

File 'virtual:/@storybook/builder-vite/vite-app.js' was not found in iframe.html #86

Closed
nadirabbas opened this issue Aug 18, 2021 · 5 comments

Comments

@nadirabbas
Copy link

nadirabbas commented Aug 18, 2021

Using Vue 2

Error in console:
image

My Vite config:

const { createVuePlugin } = require('vite-plugin-vue2')
const path = require('path')
const { visualizer } = require('rollup-plugin-visualizer')


module.exports = {
    server: { middlewareMode: 'ssr' },
    plugins: [createVuePlugin(), visualizer({
        open: true
    })],
    resolve: {
        alias: [
            {
                find: '@',
                replacement: path.resolve(__dirname, 'src')
            },
        ]
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `@import "@/assets/sass/global.scss";`
            }
        }
    },
    build: {
        rollupOptions: {
            output: {
                entryFileNames: '[name].[hash].js'
            }
        }
    }
}

My Storybook main.js:

 const viteConfig = require('../vite.config')

module.exports = {
  stories: [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-a11y",
  ],
  core: { builder: "storybook-builder-vite" },
  async viteFinal() {
    return viteConfig
  }
}
@IanVS
Copy link
Member

IanVS commented Aug 18, 2021

Vue 2 is not yet supported. There's an open PR (#66) to add support.

@ThinCats
Copy link

If you want to reuse your project's vite config, you should not just directly return it. Because it will override the configuration that builder-vite uses, which contains plugin handling virtual module vite-app.js. You can use mergeConfig provided by vite to merge configs, see #85 (comment)

@elzodxon
Copy link

[vite] Internal server error: No files matching '/virtual:/@storybook/builder-vite/vite-app.js' were found.
Vite throwing this error

@IanVS
Copy link
Member

IanVS commented Jun 28, 2022

@elzodxon please open a new issue with all of the details in the template.

@shakhzodkudratov
Copy link

shakhzodkudratov commented Jul 26, 2022

guys check this discussion for a workaround, it might be useful for you #367 (comment)

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

No branches or pull requests

6 participants