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

virtual file system is broken in v6 #18223

Open
7 tasks done
himself65 opened this issue Sep 28, 2024 · 1 comment
Open
7 tasks done

virtual file system is broken in v6 #18223

himself65 opened this issue Sep 28, 2024 · 1 comment

Comments

@himself65
Copy link

Describe the bug

import { createServer } from 'vite'

const server = await createServer({
  plugins: [
    {
      name: 'virtual-fs',
      resolveId (id) {
        if (id === 'my-virtual-file') {
          return id + '.js'
        }
      },
      load (id) {
        if (id === 'my-virtual-file.js') {
          return 'export default "Hello, world!"'
        }
      }
    }
  ]
})

console.log(await server.ssrLoadModule('my-virtual-file.js'))

await server.close()

This is working in v5, but broken in v6.

Reproduction

https://stackblitz.com/edit/stackblitz-starters-prwdrf?file=index.js

Steps to reproduce

No response

System Info

N/A

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Sep 28, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

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

1 participant