Several components not shown or not working in production mode

When running my app based on Vaadin 24 and Spring Boot in production mode components like TextArea and RichTextEditor are not working. They produce the following error in the console:

$0.dangerouslySetHtmlValue is not a function
at Object.eval (eval at Q3 (FlowClient-BZ2ixoyw.js:3:42383), :3:11)

The SpreadSheet component is not shown and produces no error.
In development mode all works fine.

Any idea?

You are weirdly instantiating them; so that the class scanner can’t find them while building the production bundle (which only include “used” Components for better performance)

Common culprits:

  • usage of reflection
  • usage of transitive depdencies / different / excluded package names from the scanner

You might need to use the @Uses annotation to make sure the production bundle picks up the right components.

Link to docs: Production Build | Deploying to Production | Vaadin Docs