legacy-knowledge-base
公開されました Sep. 10, 2025

TypeError: str.indexOf is not a function エラーが「gulp-upgrade」の実行中に発生しました

written-by

Pooja Bhambani

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • Liferay テーマを Portal 6.2 から 7.2 にアップグレードしているときに、次のエラーが発生します。
    bash-4.4# gulp upgrade
    [20:01:07] Using gulpfile /home/node/devcenter-theme/gulpfile.js
    [20:01:07] Starting 'upgrade'...
    ? We recommend creating a backup of your theme files before proceeding. Are you sure you wish to start the upgrade process? Yes
    [20:01:15] Starting 'upgrade:black-list'...
    [20:01:16] Finished 'upgrade:black-list' after 120 ms
    [20:01:16] Starting 'upgrade:replace-compass'...
    [20:01:16] Finished 'upgrade:replace-compass' after 218 ms
    [20:01:16] Starting 'upgrade:convert-bootstrap'...
    Wrote file: src/css/_aui_variables.scss
    Wrote file: src/css/_liferay_custom.scss
    Wrote file: src/css/application.css
    Wrote file: src/css/aui.css
    /home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/formatters/css.js:61
    if (str.indexOf('content-box') > -1) {
    ^

    TypeError: str.indexOf is not a function
    at constructor._checkPadding (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/formatters/css.js:61:13)
    at constructor._extractRecursive (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/formatters/css.js:247:6)
    at constructor.format (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/formatters/css.js:23:14)
    at CLI.processFileData (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/cli.js:181:28)
    at CLI.formatFile (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/cli.js:80:9)
    at CLI.onRead (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/lib/cli.js:126:9)
    at wrapper (/home/node/devcenter-theme/node_modules/convert-bootstrap-2-to-3/node_modules/lodash/index.js:3533:19)
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:54:3)

Environment

  • ポータル 6.2

解決策

  • この問題は、次の回避策を実行することで解決できます。
  • アップグレードがまだ試行されていない 6.2 テーマを取得し、次の空の CSS ルールのすべてのセットを削除します。
    - .portlet-column-content {}
    - .vv-form-group label {}
  • これを行った後、新しいアップグレード プロセスを最初からやり直します。

追加情報

コミュニティ リソースは、コミュニティ メンバーがコミュニティ メンバーのために作成したものであり、Liferay サポートによって正式に承認されていませんが、有用な情報を提供できることに注意してください。

did-this-article-resolve-your-issue

legacy-knowledge-base