Open SeyedMostafaHosseinian opened 5 months ago
It would help if you can reproduce the issue in a newly created nx project
EDIT: I was able to reproduce it, I am looking into it. It only happens on v15
hello chihab. I have been stuck with this error for a long time. After a lot of research, I came up with a clue. According to this link. This error occurs when using customized configuration, and if the webpack version does not match in bundlers.
i used from follow commands to check webpack versions:
npm ls webpack
and result:
├─┬ @angular-devkit/build-angular@15.2.10
│ ├─┬ @angular-devkit/build-webpack@0.1502.10
│ │ └── webpack@5.76.1 deduped <======================================
│ ├─┬ @ngtools/webpack@15.2.10
│ │ └── webpack@5.76.1 deduped
│ ├─┬ babel-loader@9.1.2
│ │ └── webpack@5.76.1 deduped
│ ├─┬ copy-webpack-plugin@11.0.0
│ │ └── webpack@5.76.1 deduped
│ ├─┬ css-loader@6.7.3
│ │ └── webpack@5.76.1 deduped
│ ├─┬ less-loader@11.1.0
│ │ └── webpack@5.76.1 deduped
│ ├─┬ mini-css-extract-plugin@2.7.2
│ │ └── webpack@5.76.1 deduped
│ ├─┬ postcss-loader@7.0.2
│ │ └── webpack@5.76.1 deduped
│ ├─┬ sass-loader@13.2.0
│ │ └── webpack@5.76.1 deduped
│ ├─┬ source-map-loader@4.0.1
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-dev-middleware@6.0.1
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-dev-server@4.11.1
│ │ ├─┬ webpack-dev-middleware@5.3.3
│ │ │ └── webpack@5.76.1 deduped
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-subresource-integrity@5.1.0
│ │ └── webpack@5.76.1 deduped
│ └─┬ webpack@5.76.1
│ └─┬ terser-webpack-plugin@5.3.9
│ └── webpack@5.76.1 deduped
├─┬ @ngx-env/builder@17.2.3
│ └─┬ @dotenv-run/webpack@1.3.4
│ └── webpack@5.89.0 deduped <=======================================
├─┬ @nrwl/angular@15.9.2
│ ├─┬ @nrwl/webpack@15.9.2
│ │ └── webpack@5.89.0 deduped
│ └── webpack@5.89.0
└─┬ @nrwl/webpack@15.9.4
├─┬ babel-loader@9.1.3
│ └── webpack@5.89.0 deduped
├─┬ copy-webpack-plugin@10.2.4
│ └── webpack@5.89.0 deduped
├─┬ css-loader@6.8.1
│ └── webpack@5.89.0 deduped
├─┬ css-minimizer-webpack-plugin@3.4.1
│ └── webpack@5.89.0 deduped
├─┬ file-loader@6.2.0
│ └── webpack@5.89.0 deduped
├─┬ fork-ts-checker-webpack-plugin@7.2.13
│ └── webpack@5.89.0 deduped
├─┬ less-loader@11.1.0
│ └── webpack@5.89.0 deduped
├─┬ mini-css-extract-plugin@2.4.7
│ └── webpack@5.89.0 deduped
├─┬ postcss-loader@6.2.1
│ └── webpack@5.89.0 deduped
├─┬ sass-loader@12.6.0
│ └── webpack@5.89.0 deduped
├─┬ source-map-loader@3.0.2
│ └── webpack@5.89.0 deduped
├─┬ style-loader@3.3.3
│ └── webpack@5.89.0 deduped
├─┬ stylus-loader@7.1.3
│ └── webpack@5.89.0 deduped
├─┬ terser-webpack-plugin@5.3.9
│ └── webpack@5.89.0 deduped
├─┬ ts-loader@9.5.1
│ └── webpack@5.89.0 deduped
├─┬ webpack-dev-server@4.15.1
│ ├─┬ webpack-dev-middleware@5.3.3
│ │ └── webpack@5.89.0 deduped
│ └── webpack@5.89.0 deduped
├─┬ webpack-subresource-integrity@5.1.0
│ └── webpack@5.89.0 deduped
└── webpack@5.89.0 deduped
As you can see, their webpack versions are different. I started to install webpack@5.76.1 diretly into project which I had not installed as a main package. After installation, the webpack version for ngx-env/builder@ also changed to 5.76.1 and when I ran the project It was working correctly. But do you think this is the right way to solve the problem? Is there a better way to sync the webpack version?
It should be mentioned that I installed different versions of your package and that was the problem And that I checked this in my main project for now
error:
package.json
project.json: