akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
956 stars 517 forks source link

Yarn run webpack issue #15644

Open simoncarre opened 3 years ago

simoncarre commented 3 years ago

Hi Akeneo team,

I have an issue when deploying an Akeneo project in version 3.2.84 (during yarn run webpack command) :

✓ Saved CSS to web/css/pim.css
Version: webpack 4.29.6
Time: 22803ms
Built at: 11/04/2021 5:20:00 PM
            Asset      Size  Chunks             Chunk Names
      main.min.js  3.54 MiB    main  [emitted]  main
  main.min.js.map  3.69 MiB    main  [emitted]  main
    vendor.min.js  2.56 MiB  vendor  [emitted]  vendor
vendor.min.js.map  2.93 MiB  vendor  [emitted]  vendor
Entrypoint main = vendor.min.js vendor.min.js.map main.min.js main.min.js.map

ERROR in /srv/pim/web/bundles/pimdatagrid/js/datafilter/filters-column.ts
./web/bundles/pimdatagrid/js/datafilter/filters-column.ts
[tsl] ERROR in /srv/pim/web/bundles/pimdatagrid/js/datafilter/filters-column.ts(220,24)
      TS2345: Argument of type 'HTMLElement | undefined' is not assignable to parameter of type 'Node'.
  Type 'undefined' is not assignable to type 'Node'.

I performed the following steps:

yarn install
rm -rf var/cache/*
php bin/console pim:installer:assets --symlink --clean --env=prod
yarn run less
yarn run webpack

But the issue persists. Do you have an idea of a fix before a possible migration to Akeneo 4.0? Thank you in advance.

Philippe-M commented 2 years ago

Hello, i've the same problem with update 4.0.61 -> 4.0.126 #15807

gnexus460 commented 2 years ago

did somebody solve this issue?

Philippe-M commented 2 years ago

For me no solution was found, I was forced to reload a save.

rvm-pmis commented 2 years ago

Had the same problem in Akeneo 3.2.75. Solved it by applying this patch

--- src/Oro/Bundle/PimDataGridBundle/Resources/public/js/datafilter/filters-column.ts   2022-01-21 18:03:55.817217480 +0100
+++ src/Oro/Bundle/PimDataGridBundle/Resources/public/js/datafilter/filters-column.ts   2022-01-21 18:04:14.893072191 +0100
@@ -217,7 +217,7 @@
     for (let groupName in groupedFilters) {
       const group: GridFilter[] = groupedFilters[groupName];
       const groupElement = this.renderFilterGroup(group, groupName);
-      list.appendChild($(groupElement).get(0));
+      list.appendChild($(groupElement).get(0) as any);
     }

     filterColumn.append(list);

I'm applying the patch via composer.json by running composer require cweagans/composer-patches and adding this to the "extra" section in composer.json (make sure you add a trailing comma to the line before composer-exit-on-patch-failure:

        "composer-exit-on-patch-failure": true,
        "patches": {
            "akeneo/pim-community-dev": {
                "Fix: https://github.com/akeneo/pim-community-dev/issues/15644": "patches/issue-15644.TS2345.argument.of.type.HTMLElement.undefined.is.not.assignable.to.parameter.of.type.Node.patch"
            }
        }

Looks like it was fixed in later versions via this commit on november 9th 2021: https://github.com/akeneo/pim-community-dev/commit/d4f70f9284cd3e33fd62087c98e1a8781d7f60ef#diff-f37e965cacebaf85f2b2abd78827ffd29691498affb012a8c39ffee0104d2d6e