Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

Archetype default configuration issue #222

Open jiakuan opened 1 year ago

jiakuan commented 1 year ago

I used the following two commands to generate a new Hello project:

mvn org.apache.maven.plugins:maven-dependency-plugin:get \
-DrepoUrl=https://repo.vertispan.com/j2cl/ \
-Dartifact=com.vertispan.j2cl.archetypes:j2cl-archetype-simple:0.20

and

mvn archetype:generate -DarchetypeGroupId=com.vertispan.j2cl.archetypes \
-DarchetypeArtifactId=j2cl-archetype-simple \
-DarchetypeVersion=0.20

And then I ran the project using:

mvn j2cl:build
mvn jetty:run

After I opened http://localhost:8080, I got this error from browser console:

caught TypeError: Cannot read properties of null (reading 'appendChild')
    at w (hello.js:7:875)
    at hello.js:7:912

I guessed the default .native.js provided had some issues?

treblereel commented 1 year ago

@jiakuan thanks for your report. We should fix it ... The problem is: js loads before body is created, to fix you can modify html like this:

    <script language='javascript' src='application.js' defer></script>