legacy-knowledge-base
公開されました Jun. 30, 2025

テーマをビルドできません:"エラー:期待される数値、変数、関数、または計算。 log('無効なユニット `#{$unit}`.');"

written-by

Daniel Carrillo Broeder

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

問題

  • テーマ構築時に「Expected number, variable, function, or calculation $_: log('無効な単位 `#{$unit}`.');」というエラーが発生します:
    メッセージ:
    build/_css/clay/functions/_type-conversion-functions.scss
    エラー:

    40 │ $_: log('無効な単位 `#{$unit}`.');
    │ ^
    ↪So_2575
    build/_css/clay/functions/_type-conversion-functions.scss 40:11 @import
    build/_css/clay/functions/_global-functions.scss 9:9 @import
    build/_css/clay/base.scss 5:9 @import
    build/_css/clay.scss 1:9 ルートスタイルシート
    詳細:
    formatted: Error:期待される数値、変数、関数、または計算。

環境

  • Liferay DXP 7.3+、ブレードテンプレートでテーマを構築する場合。

解像度

  • このエラーはsassバージョン1.65.1を使用しているためです。
  • liferay-theme-tasks" v11.5.3で修正されました。
  • この問題を解決するには、テーマの依存関係を再構築する必要があります:
    # NPM
    npm install && npm run build

    # Or alternatively
    yarn && yarn build
  • それでも問題が解決しない場合は、テーマのpackage.jsonを手動で変更してください。 liferay-theme-tasks "を少なくともバージョン11.5.3に更新してください:
    ...
    "devDependencies": {
    "compass-mixins": "0.12.10",
    "gulp": "4.0.2",
    "liferay-frontend-css-common": "6.0.8",
    "liferay-frontend-theme-styled": "6.0.54",
    "liferay-frontend-theme-unstyled": "6.0.45",
    "liferay-theme-tasks": "^11.5.3",
    "liferay-font-awesome": "3.5.2"
    },
    ...

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base