Update package.json for sass version#78
Conversation
Replace node-sass with sass for Node.js 18+ compatibility - node-sass has been deprecated and is no longer supported in Node.js versions 18 and above. - Replaced node-sass with sass to ensure compatibility with Node.js 18+. - This update aligns with the latest release (v9.52) which only supports Node.js 18+. Fixes build issues with newer Node.js versions.
|
Fix build issue by replacing node-sass with sass for Node.js 18+
The steps to reproduce and resolve: Clone the repository: git clone https://github.com/microsoft/Msdyn365.Commerce.Online.git |
|
Hi guys is there any update on this PR? |
|
Hey @AmazonSonii, how did you resolve the following errors? order-details.scssModule build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Expected "n".
╷
739 │ &:nth-last-child() {
│ ^
╵
node_modules/@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/styles/modules/order-details.scss 739:30 root stylesheet
content-block-tile.scss 1Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Top-level selectors may not contain the parent selector "&".
╷
169 │ &.col-sm:last-child .ms-content-block[data-m-layout="tile"]:last-child {
│ ^
╵
node_modules/@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/styles/modules/content-block-tile.scss 169:5 root stylesheet
content-block-tile.scss 2Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Top-level selectors may not contain the parent selector "&".
╷
141 │ &.col-sm:last-child .ms-content-block[data-m-layout="tile"]:last-child {
│ ^
╵
node_modules/@msdyn365-commerce-modules/fabrikam-design-kit/dist/lib/modules/fabrikam/styles/modules/content-block-tile.scss 141:5 root stylesheet
|
Yes in the upcoming version those errors have been resolved |
|
@AmanSonii: I think this will not work in that way, because |
I tried that as well but it didn't work. The best alternative I found was sass only and fortunately it worked for me. |
That is interesting. Are you using a custom theme? Unfortunately the whole ecosystem/dependencies are somehow out-of-control here. I think currently MS is stick to NodeJs |
Replace node-sass with sass for Node.js 18+ compatibility
Fixes build issues with newer Node.js versions.