question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ThinCatscommented, Aug 20, 2021

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 https://github.com/eirslett/storybook-builder-vite/issues/85#issuecomment-900831050

1reaction
shakhzodkudratovcommented, Jul 26, 2022

guys check this discussion for a workaround, it might be useful for you https://github.com/storybookjs/builder-vite/issues/367#issuecomment-1116892668

Read more comments on GitHub >

github_iconTop Results From Across the Web

File 'virtual:/@storybook/builder-vite/vite-app.js' was not found ...
Using Vue 2 Error in console: My Vite config: const { createVuePlugin } = require('vite-plugin-vue2') const path = require('path') const ...
Read more >
Iframe content not showing - html - Stack Overflow
I need to keep the onload javascript, because that is important for the functionality of the iframe. <iframe src="" class="prodframe pc" style= ...
Read more >
<iframe>: The Inline Frame element - HTML - MDN Web Docs
The HTML element represents a nested browsing context, embedding another HTML page into the current one.
Read more >
HTML iframe tag - W3Schools
The <iframe> tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document.
Read more >
The ultimate guide to iframes - LogRocket Blog
Developers mainly use the iframe tag to embed another HTML document within ... This means that the JavaScript inside the iframe will not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found