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

🐛 BUG: @cloudflare/vite-plugin vite dev errors when nodejs_compat is enabled #8108

Open
patsaas opened this issue Feb 12, 2025 · 2 comments · May be fixed by #8118
Open

🐛 BUG: @cloudflare/vite-plugin vite dev errors when nodejs_compat is enabled #8108

patsaas opened this issue Feb 12, 2025 · 2 comments · May be fixed by #8118
Labels
bug Something that isn't working vite-plugin Relating to the `@cloudflare/vite-plugin` package

Comments

@patsaas
Copy link

patsaas commented Feb 12, 2025

Which Cloudflare product(s) does this pertain to?

Other

What versions are you using?

@cloudflare/vite-plugin 0.0.8, Vite 6.1.0 and 6.0.11, Wrangler 3.108.1, Node.js v22.13.1

What operating system and version are you using?

Mac Sequoia 15.3.1 and Ubuntu 24.10

Please provide a link to a minimal reproduction

https://github.com/patsaas/cloudflare-vite-plugin-repro

Describe the Bug

The Cloudflare Vite plugin 0.0.8 should've had the nodejs_compat issue (#8054) fixed in #7830, but there's a different error now.

Repro > npm install && npm run dev > visit /api/ or click the "Name from API is" button on the homepage to reproduce the error.

Error on request to the Worker at /api/:

node:internal/fs/promises:638
  return new FileHandle(await PromisePrototypeThen(
                        ^

Error: ENOENT: no such file or directory, open '/Users/pat/cloudflare-vite-tutorial/node_modules/unenv/runtime/node/tty/index.mjs?v=79e7f969'
    at async open (node:internal/fs/promises:638:25)
    at async Object.readFile (node:internal/fs/promises:1242:14)
    at async extractExportsData (file:///Users/pat/cloudflare-vite-tutorial/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:19285:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/pat/cloudflare-vite-tutorial/node_modules/unenv/runtime/node/tty/index.mjs?v=79e7f969'
}

This occurs with both Vite 6.0.11 and 6.1.0.

Please provide any relevant error logs

No response

@patsaas patsaas added the bug Something that isn't working label Feb 12, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Feb 12, 2025
@jamesopstad jamesopstad added the vite-plugin Relating to the `@cloudflare/vite-plugin` package label Feb 12, 2025
@petebacondarwin
Copy link
Contributor

Taking a look

@swennemans
Copy link

I can reproduce it as well. For what it is worth, it does work with "vite": "6.0.11" combined with "@cloudflare/vite-plugin": "0.0.6",

petebacondarwin added a commit that referenced this issue Feb 12, 2025
petebacondarwin added a commit that referenced this issue Feb 12, 2025
@petebacondarwin petebacondarwin linked a pull request Feb 12, 2025 that will close this issue
9 tasks
@petebacondarwin petebacondarwin marked this as a duplicate of #8121 Feb 12, 2025
petebacondarwin added a commit that referenced this issue Feb 12, 2025
petebacondarwin added a commit that referenced this issue Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working vite-plugin Relating to the `@cloudflare/vite-plugin` package
Projects
Status: Untriaged
Development

Successfully merging a pull request may close this issue.

4 participants