Pim-community-dev: yarn run webpack 在全新 3.2 安装时失败

创建于 2020-09-08  ·  12评论  ·  资料来源: akeneo/pim-community-dev

:bug:我正在报告一个错误:bug:

嗨,我试图安装最新版本的描述akeneo 3.2的这个页面,无需进行任何修改。 一切似乎都很好,直到我运行yarn run webpack 。 运行时,它提供以下输出:

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.

webpack 出了点问题,但我实际上不知道这里发生了什么。 知道可能出了什么问题以及如何解决吗?


系统

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



md5-0adaed2690a3db8d913c2d72889e49a7



```console
yarn -v
1.22.5

最有用的评论

我们遇到了完全相同的问题。 某些依赖项的版本没有固定在特定版本上,而其他则是。 这导致了兼容性问题,并且将来会再次导致兼容性问题。

此时,更改两个依赖项修复了 webpack 问题:打字稿和下划线。

yarn add [email protected] @types/[email protected]

此命令中的版本非常重要。 Typescript 必须固定在 3.6.5,因为那是“发布旧版本的标签”。 并且@types/underscore 必须固定在1.8.3,这是package.json 中types/underscore 的版本。

所有12条评论

我刚刚注意到获取最新版本的下载链接是使用 akeneo 3.2.34 而不是 3.2.69 获取存档,这可能相关吗?

你好@marcoveeneman

不,这没有关系。 我将与团队核实,以了解为什么我们没有最新的 3.2 版本可供下载。

对于 Yarn 问题,最近肯定发生了一些变化:我们所有的夜间构建今天都变红了。

问候,
JM

今天早上我在安装时遇到了同样的错误,v3.2.69 和 v3.2.58

错误在 v3.2.70 中修正了吗? 升级后我仍然有同样的问题。

我在为 3.1.18 和 3.1.2 编译资产时仍然遇到错误,
使用的包大概也使用过。
我怎么能解决这个问题?

[编辑]

这可以帮助某人:
yarn add @types/[email protected]

有什么解决办法吗? 它对我的 Akeneo 不起作用...

更糟糕的是,即使在尝试从 3.2 升级到 4.0 之后,它刚刚破坏了我们的数据库……如果不是我之前所做的备份,它会破坏我们所有的 Akeneo。

在新的 akeneo Docker 安装上也有这个 webpack 问题。 上述修复对我的安装不起作用。

我们遇到了完全相同的问题。 某些依赖项的版本没有固定在特定版本上,而其他则是。 这导致了兼容性问题,并且将来会再次导致兼容性问题。

此时,更改两个依赖项修复了 webpack 问题:打字稿和下划线。

yarn add [email protected] @types/[email protected]

此命令中的版本非常重要。 Typescript 必须固定在 3.6.5,因为那是“发布旧版本的标签”。 并且@types/underscore 必须固定在1.8.3,这是package.json 中types/underscore 的版本。

经过多次尝试(Centos 8)并放弃并安装在 Ubuntu 18.04 上 - 错误从未出现在 4.0.70 版的全新 docker 安装中

我在你的解决方案@stefaanneyts 上做得有点远,但在 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.

我设法修复了我的,在运行@stefaanneyts命令后,我确实锁定了主干,并在此处建议https://github.com/akeneo/pim-community-dev/issues/13895

此页面是否有帮助?
0 / 5 - 0 等级