adobe/asset-share-commons

Asset share common 3.3.0 build error - ui.frontend.theme.light

madhuch28 opened this issue · 10 comments

Hi,

We are integrating ASC code 3.3.0 with our application code and in this process while compiling the ui.frontend gives the below error:
Havent updated any version in package.json.

Could you please help with it.

[ERROR] npm ERR! While resolving: html-webpack-plugin@5.5.0
[ERROR] npm ERR! Found: webpack@4.41.6
[ERROR] npm ERR! node_modules/webpack
[ERROR] npm ERR! dev webpack@"^4.27.1" from the root project
[ERROR] npm ERR! peer webpack@"*" from clean-webpack-plugin@3.0.0
[ERROR] npm ERR! node_modules/clean-webpack-plugin
[ERROR] npm ERR! dev clean-webpack-plugin@"^3.0.0" from the root project
[ERROR] npm ERR! 11 more (copy-webpack-plugin, css-loader, file-loader, ...)
[ERROR] npm ERR!
[ERROR] npm ERR! Could not resolve dependency:
[ERROR] npm ERR! peer webpack@"^5.20.0" from html-webpack-plugin@5.5.0
[ERROR] npm ERR! node_modules/html-webpack-plugin
[ERROR] npm ERR! dev html-webpack-plugin@"^5.5.0" from the root project
[ERROR] npm ERR!
[ERROR] npm ERR! Conflicting peer dependency: webpack@5.89.0
[ERROR] npm ERR! node_modules/webpack
[ERROR] npm ERR! peer webpack@"^5.20.0" from html-webpack-plugin@5.5.0
[ERROR] npm ERR! node_modules/html-webpack-plugin
[ERROR] npm ERR! dev html-webpack-plugin@"^5.5.0" from the root project
[ERROR] npm ERR!

What command are you running? And what version of Node.js are you using?

application uses the below node version and I'm running npm install
[INFO] Node v16.13.2 is already installed.
[INFO] NPM 9.8.0 is already installed.

can you try updating your package.json devDependencies section to:

  "devDependencies": {
    "aem-clientlib-generator": "^1.8.0",
    "autoprefixer": "^9.2.1",
    "browserslist": "^4.16.5",
    "clean-webpack-plugin": "^3.0.0",
    "copy-webpack-plugin": "^5.0.4",
    "css-loader": "^3.4.2",
    "cssnano": "^4.1.10",
    "file-loader": "^5.0.2",
    "html-webpack-plugin": "^4.0.0",
    "less": "^3.13.1",
    "less-loader": "^5.0.0",
    "mini-css-extract-plugin": "^0.4.4",
    "optimize-css-assets-webpack-plugin": "^5.0.1",
    "postcss-loader": "^3.0.0",
    "source-map-loader": "^0.2.4",
    "style-loader": "^0.14.1",
    "terser-webpack-plugin": "^1.4.1",
    "url-loader": "^3.0.0",
    "webpack": "^4.46.0", 
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.9.0",
    "webpack-import-glob-loader": "^1.6.3",
    "webpack-merge": "^4.2.1"
  },

you may need to delete node_modules and package-lock.json

Thanks @davidjgonzalez the build issue is resolved after updating the dev dependency , however the ui.frontend zip folder isnt getting created under the target folder .

tried to debug and it looks like the assembly xml file is unable to find the /dist folder .
Could you please help.

[DEBUG] -- end configuration --
[INFO] Reading assembly descriptor: assembly.xml
[DEBUG] Field directory source: ${basedir}/dist interpolated to: ./dist
[DEBUG] After assembly is interpolated:


distribution

zip

false




**/*

./dist


[DEBUG] All known ContainerDescriptorHandler components: [plexus, metaInf-services, metaInf-spring, file-aggregator]
[DEBUG] FileSet[] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'

Can you revert to original changes, remove node_modules and package-lock.json and run npm ci ?

That should work - looks like a bunch of node deps have evolved and arent compat with each other anymore ... npm ci will run a npm install but pin the versions to whats in your package-lock.json which is a combo that will work... will take more time to refactor the project to support more modern versions :(

Got it.
Tried the same way by deleting the node and node_modules and ran npm ci command and it did pick up the package-lock.json file but still gives the same error while aseembly the zip file.

[DEBUG] After assembly is interpolated:


distribution

zip

false




**/*

./dist


[DEBUG] All known ContainerDescriptorHandler components: [plexus, metaInf-services, metaInf-spring, file-aggregator]
[DEBUG] FileSet[] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'

2023-11-21 at 5 46 PM

2023-11-21 at 5 46 PM

those the commands youre running?

Thanks @davidjgonzalez, my build is successful now.

Np @madhuch28 ... i spent some time trying to get fomantic working w/ webpack 5 but getting some non-obvious less variable errors... i think this is going to be the easiest approach for now.

Yes @davidjgonzalez , it works fine with the previous version of webpack.
For now able to run the build. Have another Q on the content package - will raise another issue as this is closed.