Skip to content

Compiling UI less files raised errors #6470

Closed

Description

@hooklee2000
ISSUE TYPE
  • Bug Report
COMPONENT NAME

UI

CLOUDSTACK VERSION

4.17.0.0

OS / ENVIRONMENT

CentOS 8
node -v
v12.22.11

SUMMARY

We built all rpms successful but UI less raised errors.
btw, we found Apache CloudStack apidocs need python2, we prefer python3.

STEPS TO REPRODUCE

packaging/package.sh -d centos8

EXPECTED RESULTS

compile less successful.

ACTUAL RESULTS

built all rpms successful, but raised some errors
Error occurred compiling file /root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/src/style/ant-overwrite/ant-form.less
Error LessError: Cannot find module 'antd/lib/style/themes/default.less' from '/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/src/style/ant-overwrite'
at module.exports (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less-plugin-npm-import/node_modules/resolve/lib/sync.js:33:11)
at NpmFileManager.resolve (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less-plugin-npm-import/lib/npm-file-manager.js:29:16)
at NpmFileManager.loadFile (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less-plugin-npm-import/lib/npm-file-manager.js:52:29)
at ImportManager.push (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/import-manager.js:152:35)
at ImportVisitor.processImportNode (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/import-visitor.js:88:28)
at ImportVisitor.visitImport (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/import-visitor.js:50:22)
at Visitor.visit (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/visitor.js:76:32)
at Visitor.visitArray (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/visitor.js:102:22)
at Ruleset.accept (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/tree/ruleset.js:40:30)
at Visitor.visit (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/visitor.js:83:18)
at ImportVisitor.run (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/visitors/import-visitor.js:23:27)
at Object.parse (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/parser/parser.js:246:22)
at Object.parse (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/parse.js:84:18)
at Object.render (/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/render.js:29:18)
at /root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/node_modules/antd-theme-generator/node_modules/less/lib/less/render.js:20:24
at new Promise () {
type: 'Syntax',
filename: '/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/src/style/ant-overwrite/ant-form.less',
index: 0,
line: 1,
column: 0,
callLine: NaN,
callExtract: undefined,
extract: [
undefined,
'@import "~antd/lib/style/themes/default.less";',
'@import "/root/cloudstack-4.17.0.0/dist/rpmbuild/BUILD/cloudstack-4.17.0.0/ui/src/style/vars.less";'
]
}

Activity

  1. changed the title [-]Compiling UI less files raised errors, we changed form UglifyJS to Terser it works well.[/-] [+]Compiling UI less files raised errors, we changed form uglifyjs to terser it works well.[/+] on Jun 17, 2022
  2. changed the title [-]Compiling UI less files raised errors, we changed form uglifyjs to terser it works well.[/-] [+]Compiling UI less files raised errors[/+] on Jun 17, 2022
  3. utchoang commented on Jun 20, 2022

    @utchoang

    @hooklee2000 cc @rohityadavcloud @nvazquez This PR #6142 was created to solve this problem but it is pending merging.

  4. hooklee2000 commented on Jun 20, 2022

    @hooklee2000
    ContributorAuthor

    Thanks! It works! Btw as UglifyJS we prefer to Terser.

  5. added this to the unplanned milestone on Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions