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

PiT 24.4: Regression in alpha23 frontend compilation error #19216

Closed
Tracked by #5012
manolo opened this issue Apr 22, 2024 · 5 comments
Closed
Tracked by #5012

PiT 24.4: Regression in alpha23 frontend compilation error #19216

manolo opened this issue Apr 22, 2024 · 5 comments

Comments

@manolo
Copy link
Member

manolo commented Apr 22, 2024

Description of the bug

Vite cannot compile project after migrating to 24.4.0.alpha23.

Error is

vite v5.2.8 building for production...
transforming...
✓ 736 modules transformed.
x Build failed in 14.74s
error during build:
TypeError: Cannot read properties of null (reading 'render')
    at LogicalExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:11069:33)
    at LogicalExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:11081:24)
    at SequenceExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:11614:22)
    at IfStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:10216:23)
    at renderStatementList (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7664:25)
    at BlockStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7830:13)
    at FunctionDeclaration.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:4892:23)
    at renderStatementList (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7664:25)
    at BlockStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7830:13)
    at FunctionDeclaration.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:4892:23)
    at renderStatementList (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7664:25)
    at BlockStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7830:13)
    at ArrowFunctionExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:4892:23)
    at CallExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:9234:21)
    at VariableDeclarator.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:10604:18)
    at VariableDeclaration.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:12293:28)
    at renderStatementList (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7664:25)
    at BlockStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7830:13)
    at FunctionExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:4892:23)
    at FunctionExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:10138:15)
    at CallExpression.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:9234:21)
    at ExpressionStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:4892:23)
    at ExpressionStatement.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7761:15)
    at renderStatementList (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:7664:25)
    at Program.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:11449:13)
    at Module.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:14217:18)
    at Chunk.renderModules (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:16790:41)
    at Chunk.render (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:16286:111)
    at file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:17963:72
    at Array.map (<anonymous>)
    at renderChunks (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:17963:53)
    at Bundle.generate (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18201:19)
    at async file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:20748:27
    at async catchUnfinishedHookActions (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:20175:16)
    at async build (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:67445:22)
    at async CAC.<anonymous> (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/k8s-demo-app/node_modules/vite/dist/node/cli.js:842:9)

Expected behavior

Application compiles

Minimal reproducible example

run attached project

./mvnw -B

k8s-demo-app.zip

Versions

  • Vaadin / Flow version: 24.4.0.alpha23
@mshabarov
Copy link
Contributor

This looks very similar to rollup/rollup#5480.

Couldn't make it work with the latest versions of Vite and Rollup, throws the same exception.

Also, this issue isn't reproduced with the Vaadin+Spring Boot skeleton starter with the custom bundle.

So that might be something wrong in the K8s project config. I'm checking.

@manolo
Copy link
Member Author

manolo commented Apr 23, 2024

probably we should pin rollup version brought by the plugin-replace in https://github.com/vaadin/flow/blob/main/flow-server/src/main/resources/com/vaadin/flow/server/frontend/dependencies/vite/package.json#L15

 ├─┬ @rollup/plugin-replace@5.0.5
 │ └─┬ rollup@4.14.3
 │   ├── @rollup/rollup-linux-x64-gnu@4.14.3
 │   ├── @rollup/rollup-linux-x64-musl@4.14.3

@mshabarov
Copy link
Contributor

mshabarov commented Apr 23, 2024

rollup has a hot-fix in latest version 4.16.3 and this seems to fix the issue that we observed here.

I tried to delete package.json and package-lock.json from the attached project and re-run the app.
Then the app started fine and was fully functional.

The old package.json that has been committed, had a pinned version of rollup 4.16.1:

"node_modules/vite/node_modules/rollup": {
      "version": "4.16.1",
      ...
}

thus It was failing.

After a clean up, Vaadin generated the new package files and new bundle.

The solution for this issue is just to remove old package-lock.json and let Flow regenerate a new one.

@mshabarov
Copy link
Contributor

See vaadin/k8s-demo-app#72

@mshabarov mshabarov removed their assignment Apr 23, 2024
@mshabarov
Copy link
Contributor

I propose to close this issue @manolo .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants