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

yarn run webpack fails on fresh 3.2 installation #12698

Open
marcoveeneman opened this issue Sep 8, 2020 · 12 comments · Fixed by #12706
Open

yarn run webpack fails on fresh 3.2 installation #12698

marcoveeneman opened this issue Sep 8, 2020 · 12 comments · Fixed by #12706

Comments

@marcoveeneman
Copy link

🐛 I'm reporting a Bug 🐛

Hi, i'm trying to install the latest version of akeneo 3.2 as described on this page, without any modifications. Everything seems to be fine until i run yarn run webpack. When run, it gives the following output:

yarn run v1.22.5
$ yarn requirements && NODE_PATH=node_modules webpack --config $npm_package_config_source/webpack.config.js --env=prod
$ node $npm_package_config_source/frontend/build/check-requirements.js
Checking PIM frontend requirements
Starting webpack from /data/web/build/src in prod mode
Executing pre-build scripts
(node:8043) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
$ node $npm_package_config_styles
$ node $npm_package_config_source/frontend/build/update-extensions.js
Updating form extensions.json

Starting LESS compilation

‣ vendor/akeneo/pim-community-dev/src/Oro/Bundle/PimDataGridBundle/Resources/public/less/index.less
‣ vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/UIBundle/Resources/public/less/index.less


✓ Saved CSS to web/css/pim.css
Version: webpack 4.29.6
Time: 29633ms
Built at: 09/08/2020 7:09:36 PM
 2 assets
Entrypoint main = vendor.min.js main.min.js

ERROR in /data/web/build/src/web/bundles/pimdatagrid/js/datagrid/column-selector.ts
./web/bundles/pimdatagrid/js/datagrid/column-selector.ts
[tsl] ERROR in /data/web/build/src/web/bundles/pimdatagrid/js/datagrid/column-selector.ts(466,5)
      TS2322: Type 'Partial<{ [name: string]: Column; }>' is not assignable to type '{ [name: string]: Column; }'.
  Index signatures are incompatible.
    Type 'Column | undefined' is not assignable to type 'Column'.
      Type 'undefined' is not assignable to type 'Column'.

ERROR in /data/web/build/src/web/bundles/pimui/js/view/base.ts
./web/bundles/pimui/js/view/base.ts
[tsl] ERROR in /data/web/build/src/web/bundles/pimui/js/view/base.ts(94,28)
      TS2538: Type 'undefined' cannot be used as an index type.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Something is going wrong with webpack, but i have actually no clue what's going on here. Any idea what could be going wrong and how to solve it?

System
cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
php -v
PHP 7.2.30-1hypernode20200420.033518 (cli) (built: Apr 19 2020 07:47:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.3.8, Copyright (c) 2002-2019, by ionCube Ltd.
    with Zend OPcache v7.2.30-1hypernode20200420.033518, Copyright (c) 1999-2018, by Zend Technologies
node -v
v10.22.0
yarn -v
1.22.5
@marcoveeneman
Copy link
Author

I just noticed that the download link for getting the latest version is getting an archive with akeneo 3.2.34 instead of 3.2.69, could this be related?

@jmleroux
Copy link
Contributor

jmleroux commented Sep 9, 2020

Hello @marcoveeneman ,

Nope, it's not related. I will check with the teams to know why we don't have the last 3.2 release to download.

For the Yarn issue, something must have change recently: all our nightly builds went red today.

Regards,
JM

@EtheranNebel
Copy link

I have the same bug for an installation this morning, with v3.2.69 and v3.2.58

@jmleroux
Copy link
Contributor

jmleroux commented Sep 9, 2020

Fixed by #12706 and akeneo/pim-community-standard#1386

@jmleroux jmleroux linked a pull request Sep 9, 2020 that will close this issue
@EtheranNebel
Copy link

Is the bug corrected in v3.2.70? I still have the same problem after upgrade.

@Zzareb
Copy link

Zzareb commented Sep 18, 2020

I still encounter the error while compiling assets for 3.1.18 and 3.1.2,
the packages used are presumably used as well.
How could I fix this ?

[EDIT]

This could help someone :
yarn add @types/underscore@1.8.3

@maximuspoder
Copy link

Any solution? It didn't work for my Akeneo...

And what's even worst than that is even though after trying to upgrade from 3.2 to 4.0 it has just broken our database... if wasn't for the backup that I did before it would have screwed all our Akeneo.

@BenoitBalliu1
Copy link

Also having this webpack issue on a new akeneo Docker install. The above mentioned fix does not work for my install.

@stefaanneyts
Copy link

We had exactly the same issue. The versions of some of the dependencies are not pinned on a specific version, while others are. This caused compatibility issues, and will again cause compatibility issues in the future.

At this moment, changing two dependencies fixes the webpack issues: typescript and underscore.

yarn add typescript@3.6.5 @types/underscore@1.8.3

The versions in this command are very important. Typescript must be pinned at 3.6.5 because that's the "tag-for-publishing-older-releases". And @types/underscore must be pinned at 1.8.3, which is the version of the types/underscore in the package.json.

@BenoitBalliu1
Copy link

BenoitBalliu1 commented Nov 12, 2020

After multiple tries (Centos 8) gave up and installed on Ubuntu 18.04 - Error never showed up on fresh docker install of version 4.0.70

@nei
Copy link
Contributor

nei commented Mar 9, 2021

I've managed go a bit far with your solution @stefaanneyts but still some errors on 3.2.27

✓ Saved CSS to web/css/pim.css
Version: webpack 4.29.6
Time: 14202ms
Built at: 03/09/2021 3:06:47 AM
 2 assets
Entrypoint main = vendor.min.js main.min.js

ERROR in /var/www/html/staging/releases/1615231581/web/bundles/pimui/js/view/base.ts
./web/bundles/pimui/js/view/base.ts
[tsl] ERROR in /var/www/html/staging/releases/1615231581/web/bundles/pimui/js/view/base.ts(193,3)
      TS2416: Property 'render' in type 'BaseView' is not assignable to the same property in base type 'View'.
  Type '() => View' is not assignable to type '() => this'.

ERROR in /var/www/html/staging/releases/1615231581/web/bundles/pimui/js/view/base.ts
./web/bundles/pimui/js/view/base.ts
[tsl] ERROR in /var/www/html/staging/releases/1615231581/web/bundles/pimui/js/view/base.ts(193,3)
      TS2416: Property 'render' in type 'BaseView' is not assignable to the same property in base type 'View<any>'.
  Type '() => View' is not assignable to type '() => this'.
    Type 'View' is not assignable to type 'this'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@nei
Copy link
Contributor

nei commented Mar 11, 2021

I've managed to fix mine, after running @stefaanneyts commands I did locked backbone as well as suggested here #13895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants