I started a project last year on Vaadin 24.3.5
I’ve recently started working on it again and updated the pom.xml Vaadin version to 24.6.1, Now I see this console error after sending a production build to gcloud
through the command line using mvnw package appengine:deploy -Pproduction
indexhtml-CEs0nSIY.js:175 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at indexhtml-CEs0nSIY.js:175:1002
following the console link to the code I see
Vm = Mx([nw("copilot-main")], Vm);
const Cx = window.Vaadin
, Sx = {
init(i) {
k3( () => window.Vaadin.devTools, t => {
const e = t.handleFrontendMessage;
t.handleFrontendMessage = n => {
ax(n) || e.call(t, n)
}
}
)
}
};
Cx.devToolsPlugins.push(Sx);
which appears to be located in a generated source file that focuses on copilot
Good idea, but that did not change the problem nor error.
I tried the exact production profile from that latest start.vaadin.com
-oddly it launched a localhost browser 3 or more times while doing the production build, it didn’t do that before.
-the build still finished with success
[INFO] GCLOUD: To view your application in the web browser run:
[INFO] GCLOUD: $ gcloud app browse
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
my new production profile based on your feedback:
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<dependencies>
<!-- Exclude development dependencies from production -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
I’ll look closer at the rest of the pom.xml differences in about 12 hours.
I’m still running into the same problem.
I have used as much of the latest starter pom.xml as I could.
in the process flyway stopped working so I removed it.
here is my current pom.xml with the project name replaced with example and with all comments removed.
at this point mvn package and mvn install succeeds. my localhost debug build is working, but when I do a production build to gcloud, I get the same console error and same blank page as before.
At build time everything appears to be successful, that console error is the only clue I have.
I have briefly tried going back to an older version of Vaadin like I was using last year, and that gives me other errors like failure to build frontEnd… even if i revert the entire code base.
Maybe I should start with the latest vaadin-start and see if i can deploy a production build of that to gcloud and then bring my project over a little at a time. besides that tedious idea I’m feeling pretty stuck.
Thank you both @knoobie and @marcoc_753 for pointing me in the right direction with the fact that development stuff was in my build, meaning it wasn’t a production build in some way for some reason.
there are probably some better changes that could be made, but I am happy enough changing my produciton build command to include the vaadin.force.production.build setting