wontlost-ltd / vaadin-litelement-ckeditor

Vaadin14+LitElement+CKEditor5
Other
17 stars 13 forks source link

Lit bundled version is showing 2.2.3 when it should be 2.3.0 #34

Closed FollowSteph closed 1 year ago

FollowSteph commented 2 years ago
Running Vite to compile frontend resources. This may take a moment, please stand by...
@vaadin/bundles has version mismatches with installed packages, Vaadin component dependency bundles are disabled.
Packages with version mismatches: [
   {
     "name": "lit",
     "bundledVersion": "2.2.3",
     "installedVersion": "2.4.0"
   }
 ]

As mentioned on the vaadin page yes I'm using maven. I've been using "mvn clean install" to be safe. I also deleted the node_modules folder in case there was some caching.

My pom.xml includes:

    <properties>
        <java.version>17</java.version>
        <vaadin.version>23.2.4</vaadin.version>
        <selenium.version>4.1.2</selenium.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.1</version>
    </parent>

...

        <dependency>
            <groupId>com.wontlost</groupId>
            <artifactId>ckeditor-vaadin</artifactId>
            <version>3.1.2</version>
        </dependency>

Some more output from my web console:

vite v2.9.13 dev server running at:

and:

 X [ERROR] [plugin vite:dep-pre-bundle] Missing "./directives/class-map" export in "lit" package

     node_modules/vite/dist/node/chunks/dep-80fe9c6b.js:38572:7:
       38572 │   throw new Error(
                   ╵         ^

If there's anything I can do on my side please let me know. And if it's quicker and easier to contact me directly please let me know also and I'll be happy to do whatever I can.

FollowSteph commented 2 years ago

Here's what's even weirder. I decompiled the maven external libraries (in Intellij) and your last change in the VaadinCKEditor class is there. That is:

@NpmPackage(
    value = "lit",
    version = "^2.3.0"
)

However if I remove the ckeditor dependency from the pom.xml file it works as expected with no errors...

FollowSteph commented 2 years ago

Could it be related to vaadin-applayout-addon.version ? I ask because there appears to be a new version for vaadin 21+... I don't know much about the code so I'm please keep in mind I'm just throwing out ideas. I don't see how that wouldn't impact you as well but again just throwing out ideas.

FollowSteph commented 2 years ago

I've also tried to clean the npm cache with: npm cache clean --force without any luck.

FollowSteph commented 2 years ago

I've also tried to invalidate the cache within Intellij and no success.

That being said I'm seeing the following in my package-lock.json file (meaning it's not likely a caching issue):

    "node_modules/lit": {
      "version": "2.4.0",
      "resolved": "https://registry.npmjs.org/lit/-/lit-2.4.0.tgz",
      "integrity": "...."
      "dependencies": {
        "@lit/reactive-element": "^1.4.0",
        "lit-element": "^3.2.0",
        "lit-html": "^2.4.0"
      }
    },

and:

    "node_modules/@vaadin/bundles": {
      "version": "23.2.4",
...
        "lit": "2.3.0",

Meaning if I understand correctly something is trying to push 2.4.0 into the package-lock.json file.

FollowSteph commented 2 years ago

Great news, it works now!! I have no idea what the issue was but I had to completely re-create the project from scratch. That is I had to create a new project in Intellij by cloning the git repo and then adding the same code changes (before running either mvn or npm) and it worked. And even then it still took a few application reboots to get everything up and running. Something somewhere was mixing the versions. I have no idea what as you can see from my comments but something was messing things up. It was only out of desperation that I tried to do a full project rebuild. I wish I could give you more details, I tried everything I could think of. The only solution that worked was a complete rebuild. I'm going to delete my other comments on the Vaadin website but leave the one with the link here in case others have the same issue. Please feel free to adjust as you see fit. I'm also wondering if that may not be the issue with others as well...