twbs / bootstrap-sass

Official Sass port of Bootstrap 2 and 3.
http://getbootstrap.com/css/#sass
MIT License
12.6k stars 3.53k forks source link

Update packagist for 3.4.3 #1228

Open Eseperio opened 2 years ago

Eseperio commented 2 years ago

Last stable release available in Packagist is 3.4.2, which contains a bug using Math.div in a wrong place and this prevents compiling any project. 3.4.1 uses older math methods and keeps flooding the console with Sass warnings

snemkaramanoglu commented 2 years ago

is there any solution about this issue? When my version was 3.4.1, I was getting this error. I updated the version 3.4.3 and I continue to get the same error.

SassError: Invalid CSS after "... floor(math": expected expression (e.g. 1px, bold), was ".div($grid-gutter-w" on line 369 of node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss

vbar-padding-horizontal: floor(math.div($grid-gutter-width, 2)) !defa @AprilArcus

AprilArcus commented 2 years ago

it looks like you might be using an older version of sass. Can you share more of your error?

snemkaramanoglu commented 2 years ago

I think so. I am sharing the log details. @AprilArcus

ModuleBuildError: Module build failed .../node_modules/sass-loader/dist/cjs.js): SassError: Invalid CSS after "... floor(math": expected expression (e.g. 1px, bold), was ".div($grid-gutter-w" on line 369 of node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss

    from line 20 of ...\src\styles.scss

vbar-padding-horizontal: floor(math.div($grid-gutter-width, 2)) !defa ------------------------------------------^

at...node_modules\webpack\lib\NormalModule.js:316:20
at ...\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at ...\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at ...\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at ...\node_modules\sass-loader\dist\index.js:73:7)
at ...\node_modules\neo-async\async.js:8069:18)
at options.error (...\node-sass\lib\index.js:294:32)
AprilArcus commented 2 years ago

Yes, you're using node-sass, where you need to be using dart-sass for this and future versions. Can you please share the version of sass-loader you're using, and the part of your webpack config where you set up sass-loader?

snemkaramanoglu commented 2 years ago

I am sharing ;

"7.1.0": {
    "name": "sass-loader",
    "description": "Sass loader for webpack",
    "version": "7.1.0",
    "author": {
        "name": "J. Tangelder"
    },
    "homepage": "https://github.com/webpack-contrib/sass-loader",
    "repository": {
        "type": "git",
        "url": "git+https://github.com/webpack-contrib/sass-loader.git"
    },
    "bugs": {
        "url": "https://github.com/webpack-contrib/sass-loader/issues"
    },
    "engines": {
        "node": ">= 6.9.0 || >= 8.9.0"
    },
    "main": "lib/loader.js",
    "dependencies": {
        "clone-deep": "^2.0.1",
        "loader-utils": "^1.0.1",
        "lodash.tail": "^4.1.1",
        "neo-async": "^2.5.0",
        "pify": "^3.0.0",
        "semver": "^5.5.0"
    },
    "devDependencies": {
        "bootstrap-sass": "^3.3.5",
        "css-loader": "^0.28.4",
        "eslint": "^3.16.0",
        "eslint-config-peerigon": "^9.0.0",
        "eslint-plugin-jsdoc": "^2.4.0",
        "file-loader": "^0.11.2",
        "mocha": "^3.0.2",
        "mock-require": "^3.0.1",
        "node-sass": "^4.5.0",
        "nyc": "^11.0.2",
        "raw-loader": "^0.5.1",
        "sass": "^1.3.0",
        "should": "^11.2.0",
        "standard-version": "^4.2.0",
        "style-loader": "^0.18.2",
        "webpack": "^4.5.0",
        "webpack-dev-server": "^2.4.1",
        "webpack-merge": "^4.0.0"
    },
    "peerDependencies": {
        "webpack": "^3.0.0 || ^4.0.0"
    },
    "keywords": [

        "maintainers": [
            ...
        ],
        "directories": {},
        ...
        "_npmVersion": "5.6.0",
        "_id": "sass-loader@7.1.0",
        "dist": {},

        "_nodeVersion": `"8.11.3"`

Can't the problem be solved without updating the version? Normally, we were not getting any errors while our application was being built 1 month ago. @AprilArcus

AprilArcus commented 2 years ago

Can't the problem be solved without updating the version?

You can pin bootstrap-sass to version 3.4.1 by changing the line

        "bootstrap-sass": "^3.3.5",

to

        "bootstrap-sass": "3.4.1",

In your package.json. Note the removal of the leading ^ character.

If you want to use version 3.4.3, you must remove "node-sass", update your "sass" pin to (at least) 1.33, and update your "sass-loader" pin to at least 7.1.0 and preferably to 9.x or greater.

Note that according to your package.json, your version of NodeJS is 8.11.3. As such, the most recent version of sass-loader that will work with your version of NodeJS is 8.0.2, due to https://github.com/webpack-contrib/sass-loader/pull/828

Also note that according to your package.json, your version of Webpack is 4.x. As such, the most recent version of sass-loader that will work with your version of Webpack is 10.2.0, due to https://github.com/webpack-contrib/sass-loader/pull/912

If you choose sass-loader 7.1.0 or 8.x, you will additionally need to configure it to use dart-sass by passing the implementation option to the loader in your webpack config. From sass-loader 9.x onward, dart-sass is default and does not need to be configured.

See

snemkaramanoglu commented 2 years ago

Thank you so much for detail explanations.@AprilArcus