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

Upgrading to Vite 6.0.7 does not work because of buildSwPlugin #20808

Open
Artur- opened this issue Jan 7, 2025 · 0 comments
Open

Upgrading to Vite 6.0.7 does not work because of buildSwPlugin #20808

Artur- opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
bug Impact: Low Severity: Major vite Tickets related to vite support

Comments

@Artur-
Copy link
Member

Artur- commented Jan 7, 2025

Description of the bug

This code

const bundle = await rollup.rollup({
input: path.resolve(settings.clientServiceWorkerSource),
plugins
});
try {
return await bundle[action]({
file: path.resolve(buildOutputFolder, 'sw.js'),
format: 'es',
exports: 'none',
sourcemap: config.command === 'serve' || config.build.sourcemap,
inlineDynamicImports: true
});
} finally {
await bundle.close();
}

no longer works with Vite 6.0.7 as the Vite esbuild plugin now relies on Vite internals, so the build fails with

error during build:
TypeError: Cannot read properties of undefined (reading 'config')
    at Object.renderChunk (file:///.../flow-tests/test-express-build/test-dev-bundle/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:12289:39)
    at file:///.../flow-tests/test-express-build/test-dev-bundle/node_modules/rollup/dist/es/shared/node-entry.js:20812:40

See #20799 and vitejs/vite#19144

The code was original implemented in #12928 by @vursen who recalls that the Vite build API was not adequate back then for the task, but it has been 3 years

Expected behavior

It works

Minimal reproducible example

#20799

Versions

  • Vaadin / Flow version: latest
@mshabarov mshabarov added bug vite Tickets related to vite support Impact: Low Severity: Major labels Jan 7, 2025
@mshabarov mshabarov moved this to 🪵Product backlog in Vaadin Flow ongoing work (Vaadin 10+) Jan 7, 2025
@mshabarov mshabarov moved this to 🔖 High Priority (P1) in Vaadin Flow bugs & maintenance (Vaadin 10+) Jan 7, 2025
@mshabarov mshabarov moved this from 🪵Product backlog to 🟢Ready to Go in Vaadin Flow ongoing work (Vaadin 10+) Jan 8, 2025
@tepi tepi self-assigned this Jan 10, 2025
@tepi tepi moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow ongoing work (Vaadin 10+) Jan 10, 2025
@tepi tepi moved this from ⚒️ In progress to 🟢Ready to Go in Vaadin Flow ongoing work (Vaadin 10+) Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: Low Severity: Major vite Tickets related to vite support
Projects
Status: 🔖 High Priority (P1)
Status: 🟢Ready to Go
Development

No branches or pull requests

3 participants