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

Production build breaks future development #20294

Closed
marcushellberg opened this issue Oct 21, 2024 · 5 comments · Fixed by #20346
Closed

Production build breaks future development #20294

marcushellberg opened this issue Oct 21, 2024 · 5 comments · Fixed by #20346

Comments

@marcushellberg
Copy link
Member

Description of the bug

After building a production build of my 24.5 application, development mode is broken.

Initially, I was missing the dev mode gizmo and no changes were reloaded

After running mvn clean, I got an empty screen with the following error in the browser console

copilot-Cn85U7pa.js:5073 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
    at copilot-Cn85U7pa.js:5073:20

Finally, after deleting src/main/bundles/prod.bundle, did the app start working again as expected.

Expected behavior

Creating a production build should not break development mode. I should continue to be able to run Application.java and have access to the dev mode gizmo and its features. I should not need to run mvn clean or delete any files to get my app back to a working state.

Minimal reproducible example

App from start.vaadin.com with Flow and Hilla views.

Versions

  • Vaadin / Flow version: 24.5
  • Java version: 21
@caalador
Copy link
Contributor

Can not reproduce the issue. Any specific steps to get it to reproduce?

@marcushellberg
Copy link
Member Author

For me, it was enough to run one mvn -Pproduction package to get this to happen.

@caalador
Copy link
Contributor

caalador commented Oct 25, 2024

For some reason not when running mvn package -Pproduction but instead mvn install -Pproduction I get left with flow-build-info.json in target/classes which says "productionMode": true, and as that's not cleaned when starting in development mode, so it is found and the state is set to production for the running application.

@caalador
Copy link
Contributor

Seems the main issue is somewhere in vaadin-spring init (running Application from idea for example), as running the application in dev mode using maven we do get the development mode correctly.

@marcushellberg
Copy link
Member Author

Yes, I always run the application from the IDE, not through maven.

caalador added a commit that referenced this issue Oct 28, 2024
Clean the token file after
production build/execution
to not make ide app execution
run app in production mode.

Closes #20294
mshabarov pushed a commit that referenced this issue Oct 30, 2024
Clean the token file after
production build/execution
to not make ide app execution
run app in production mode.

Closes #20294
@github-project-automation github-project-automation bot moved this from 🔖 High Priority (P1) to ✅ Closed in Vaadin Flow bugs & maintenance (Vaadin 10+) Oct 30, 2024
@github-project-automation github-project-automation bot moved this from 🪵Product backlog to Done in Vaadin Flow ongoing work (Vaadin 10+) Oct 30, 2024
vaadin-bot pushed a commit that referenced this issue Oct 30, 2024
Clean the token file after
production build/execution
to not make ide app execution
run app in production mode.

Closes #20294
vaadin-bot added a commit that referenced this issue Oct 30, 2024
Clean the token file after
production build/execution
to not make ide app execution
run app in production mode.

Closes #20294

Co-authored-by: caalador <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants