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

Breaks with new Vite 6 #130

Open
giacomorebonato opened this issue Nov 27, 2024 · 4 comments
Open

Breaks with new Vite 6 #130

giacomorebonato opened this issue Nov 27, 2024 · 4 comments

Comments

@giacomorebonato
Copy link
Contributor

Looking into this issue

files generated
  dist/client/sw.js
  dist/client/workbox-4723e66c.js
error during build:
[vite:manifest] Cannot read properties of undefined (reading 'length')
    at Object.generateBundle (file:///Users/grebonato/Code/fastrat/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BcnkIxro.js:13576:58)
    at Object.handler (file:///Users/grebonato/Code/fastrat/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BcnkIxro.js:50852:15)
    at file:///Users/grebonato/Code/fastrat/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20812:40

giacomorebonato/fastrat#838

@cyco130
Copy link
Owner

cyco130 commented Nov 30, 2024

Hi!

I just upgraded the project to Vite 6 and the CI (which is pretty extensive) is green for me. I've also been using Rakkas with Vite 6 since the early beta days with no issues. I'm giving Rakkas as an example because it is in some ways similar to your project (which looks pretty cool, starred!), basically a metaframework that uses parts of vavite.

Are you sure the problem is related to vavite and not to some other component of your project? The attached error doesn't seem to come from vavite, for example.

In other words, I'm gonna have to give you the dreaded "I'll need a minimal repro to look into it" :)

@martinkruusement
Copy link

==> /var/log/api/err1.log <==
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
4:24:35 PM [vite] Internal server error: createViteRuntime is not a function
      at file:///var/api/node_modules/@vavite/connect/dist/index.js:66:39
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

createViteRuntime was removed in v6:
vitejs/vite#16358 (comment)

@oldium
Copy link

oldium commented Feb 10, 2025

The original issue from @giacomorebonato seems to be in vite-plugin-pwa actually, see here.

The missing createViteRuntime reported by @martinkruusement is a real Vite 6 compatibility issue when useViteRuntime is true:

if (useViteRuntime) {
if (!viteRuntime) {
const { createViteRuntime } = await import("vite");
viteRuntime = await createViteRuntime(viteServer);
}
runner = viteRuntime.executeEntrypoint.bind(viteRuntime);
}

The experimental API has changed, from this Pull Request it is visible what have changed. But it seems there were more changes to the API - see documentation, the end result is different.

I just had a quick look at the repository and it seems that there are no tests for useViteRuntime=true @cyco130, so this “breaking” change (not breaking according to Vite devs, because of the experimental nature) went unnoticed.

@giacomorebonato
Copy link
Contributor Author

Thanks @oldium for finding that!

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

4 participants