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

many vaadin addons not working with vaadin flow 24.3.3 #66

Closed
cupidogiuseppe opened this issue Feb 11, 2024 · 17 comments
Closed

many vaadin addons not working with vaadin flow 24.3.3 #66

cupidogiuseppe opened this issue Feb 11, 2024 · 17 comments
Labels
addon Issue related to a specific add-on

Comments

@cupidogiuseppe
Copy link

I cannot include in my vaadin projects many addons, certified for vaadin 24, because they are not visible in web pages.
I noticed this problem for addons that wrap javascript component, like ace editor.
I do not know if the javascript error showed in the image below could be related with this issue or i missed some build step.

image

This is my development environment:

  • macbook pro
  • Intellij 2024.3
  • quarkus vaadin integration

my pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>it.groupama</groupId>
  <artifactId>vaadin-test</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <properties>
    <compiler-plugin.version>3.12.1</compiler-plugin.version>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
    <quarkus.platform.version>3.7.2</quarkus.platform.version>
    <skipITs>true</skipITs>
    <surefire-plugin.version>3.2.5</surefire-plugin.version>
    <vaadin.version>24.3.3</vaadin.version>
  </properties>
  <repositories>
    <repository>
      <id>Vaadin Directory</id>
      <url>https://maven.vaadin.com/vaadin-addons</url>
      <snapshots/>
    </repository>
    <repository>
      <id>vaadin-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
    </repository>
    <repository>
      <id>vaadin-prereleases</id>
      <url>
        https://maven.vaadin.com/vaadin-prereleases/
      </url>
    </repository>
  </repositories>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-bom</artifactId>
        <type>pom</type>
        <scope>import</scope>
        <version>${vaadin.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-reactive</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-graphql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-arc</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-quarkus-extension</artifactId>
      <version>${vaadin.version}</version>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-jandex</artifactId>
    </dependency>
    <dependency>
      <groupId>com.hilerio</groupId>
      <artifactId>ace-widget</artifactId>
      <version>1.0.2</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus.platform.version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
              <goal>generate-code</goal>
              <goal>generate-code-tests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <compilerArgs>
            <arg>-parameters</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <configuration>
          <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <!--suppress UnresolvedMavenProperty -->
            <maven.home>${maven.home}</maven.home>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <!--suppress UnresolvedMavenProperty -->
            <maven.home>${maven.home}</maven.home>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>native</id>
      <activation>
        <property>
          <name>native</name>
        </property>
      </activation>
      <properties>
        <skipITs>false</skipITs>
        <quarkus.package.type>native</quarkus.package.type>
      </properties>
    </profile>
    <profile>
      <!-- Vaadin Production mode is activated using -Pproduction -->
      <id>prod</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-frontend</goal>
                  <goal>build-frontend</goal>
                </goals>
                <phase>compile</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
@samie
Copy link
Member

samie commented Feb 12, 2024

We are talking about this component? https://vaadin.com/directory/component/ace-widget1 if so, it is better to report this issue in the component repository at https://github.com/Sergio70/AceEditorV14/issues

Looking at the release notes, it might be marked "14+" without actually testing it on 24, but problem can also be in the integrated JS.

@samie samie added the addon Issue related to a specific add-on label Feb 12, 2024
@cupidogiuseppe
Copy link
Author

@samie
Copy link
Member

samie commented Feb 12, 2024

Ok, I see. I made a PR to ace-widget with the necessary V24 updates to see what what might be the issue. From 14 to 24 the biggest change is to Jakarta EE which is not compatible, but in this case I think it is the @Id from Polymer that causes the problems. It would make sense to upgrade from Polymer to Lit altogether, but with these changes it should work.

(Edit: There is now Vaadin 24 compatible version of ace-widget at There is now released version for Vaadin 24+ at https://vaadin.com/directory/component/ace-widget1/2.0.0)

@javier-godoy
Copy link

Hello. As a maintainer of grid-exporter-add-on and year-month-calendar-add-on, I can confirm that both of them should work with Vaadin 24.3 (indeed, our demo site was at 24.3 until a few weeks ago when we upgraded to 24.4.alpha).

Please note that you have to add com.flowingcode to the whitelist of your application (see note in README).

If that doesn't fix the issue, please create a new one in any of the add-on repositories, since vaadin/directory is intended for issues with the Directory itself, and we add-on authors don't monitor it actively:

@cupidogiuseppe
Copy link
Author

An update.
The problem seems to be connected with Quarkus vaadin integration.
With spring it works.

@samie
Copy link
Member

samie commented Feb 19, 2024

Thanks for the update! this this likely two different problems: general compatibility with Quarkus and add-on compatibility with Vaadin versions.

@ckosmowski
Copy link

ckosmowski commented Mar 2, 2024

I have the same problem Vaadin 24.3.5, Quarkus 3.8.1, quarkus integration, ace-widget 2.0.0.

image

It's also the same for several components especially i tried all the various ace-editor widgets from the add-on repository.

@mstahv
Copy link
Member

mstahv commented Mar 4, 2024

Tested quickly with the ace add-on and it looks like the "dev mode" can't handle add-on components that have client-side extensions (add-ons that trigger npm build) properly. Running in production mode works though. So the workaround is (if you don't need anything else from the dev-mode):

@mstahv
Copy link
Member

mstahv commented Mar 4, 2024

@mstahv
Copy link
Member

mstahv commented Mar 4, 2024

Verified, with e.g. ace widget, adding these to application.properties everything seems to work fine for me:

quarkus.index-dependency.hilerio.group-id=com.hilerio
quarkus.index-dependency.hilerio.artifact-id=ace-widget

@cupidogiuseppe
Copy link
Author

Verified, with e.g. ace widget, adding these to application.properties everything seems to work fine for me:

quarkus.index-dependency.hilerio.group-id=com.hilerio
quarkus.index-dependency.hilerio.artifact-id=ace-widget

I confirm that works fine

@samie
Copy link
Member

samie commented Mar 4, 2024

Thanks for letting us know! Looks like we need some extra information for Quarkus users. The errors are really misleading.

I created #68 We can continue discussing the solutions there.

@samie samie closed this as completed Mar 4, 2024
@ckosmowski
Copy link

Verified, with e.g. ace widget, adding these to application.properties everything seems to work fine for me:

quarkus.index-dependency.hilerio.group-id=com.hilerio
quarkus.index-dependency.hilerio.artifact-id=ace-widget

Just for my understanding with this solution, do we still need the production profile?

@mstahv
Copy link
Member

mstahv commented Mar 4, 2024

Yes, you should use production build when building a production artifact. This way the front-end bundle is optimised and the final artifact is slimmer (and doesn't need npm). For example in your CI pipeline your build should be mvn install -Pproduction instead of just mvn install.

@ckosmowski
Copy link

Okay my question was obviously ambiguous. I was wondering if i need the production profile for Dev mode when I want the ace editor to work. I use the dev mode a lot because of the automatic recompile and restart.

@mstahv
Copy link
Member

mstahv commented Mar 4, 2024

Ah :-) I don't think it is needed then. At least my dev mode started just fine and the ace add-on was shown once the jandex index was there. I guess we could encourige add-on developers to generate jandex index automatically. Like making OSGi bunde, it is pretty much one time job and then makes the jar file more compatible 🤷‍♂️

@ckosmowski
Copy link

Ah :-) I don't think it is needed then. At least my dev mode started just fine and the ace add-on was shown once the jandex index was there. I guess we could encourige add-on developers to generate jandex index automatically. Like making OSGi bunde, it is pretty much one time job and then makes the jar file more compatible 🤷‍♂️

Awesome that worked for me! Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon Issue related to a specific add-on
Projects
None yet
Development

No branches or pull requests

5 participants