StartBootstrap / startbootstrap-sb-admin-2

A free, open source, Bootstrap admin theme created by Start Bootstrap
https://startbootstrap.com/themes/sb-admin-2/
MIT License
9.76k stars 5.72k forks source link

Module build failed: ModuleBuildError: Module build failed: Unclosed block (229:4) #287

Closed jonathangreco closed 4 years ago

jonathangreco commented 5 years ago

After a fresh install with a old package.json I've experienced a regression in bootstrap.scss

Here's my package.json.

{
  "license": "UNLICENSED",
  "private": true,
  "scripts": {
    "dev-server": "encore dev-server",
    "dev": "encore dev",
    "watch": "encore dev --watch",
    "build": "encore production",
    "heroku-postbuild": "node_modules/.bin/encore production"
  },
  "engines": {
    "node": "8.9.0"
  },
  "dependencies": {
    "@symfony/webpack-encore": "^0.19.0",
    "bootstrap": "^4.3.1",
    "bootstrap-waitingfor": "^1.2.7",
    "copy-webpack-plugin": "^4.5.1",
    "datatables.net": "^1.10.19",
    "datatables.net-autofill-bs4": "^2.3.3",
    "datatables.net-bs4": "^1.10.19",
    "datatables.net-buttons-bs4": "^1.5.6",
    "datatables.net-fixedcolumns-bs4": "^3.2.6",
    "flot-latest": "^0.8.4",
    "jquery": "^3.3.1",
    "popper.js": "^1.14.3",
    "raphael": "^2.2.7",
    "startbootstrap-sb-admin-2": "4.0.2",
    "symfony-collection": "github:ninsuo/symfony-collection"
  },
  "devDependencies": {
    "gulp": "^4.0.0",
    "node-sass": "^4.11.0",
    "sass-loader": "^7.1.0"
  }
}

This fresh install blocked me, as a workaround I had to use an old yarn.lock to make it work.

Any idea ?

I use this with webpack encore and Symfony.

full Error

make encore
yarn run encore dev
yarn run v1.15.2
$ /Users/leaddev/mnt/multiclient_php/node_modules/.bin/encore dev
Running webpack ...

 ERROR  Failed to compile with 2 errors                                                                                                     16:30:02

 error  in ./node_modules/startbootstrap-sb-admin-2/vendor/bootstrap/scss/bootstrap.scss

Module build failed: ModuleBuildError: Module build failed: Unclosed block (229:4)

  227 |   padding-top: .75rem;
  228 |   padding-bottom: .75rem;
> 229 |   color: #6c757d;
      |    ^
  230 |   text-align: left;
  231 |   caption-side: bottom;
  232 | }

    at runLoaders (/Users/leaddev/mnt/multiclient_php/node_modules/webpack/lib/NormalModule.js:195:19)
    at /Users/leaddev/mnt/multiclient_php/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/leaddev/mnt/multiclient_php/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/leaddev/mnt/multiclient_php/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/Users/leaddev/mnt/multiclient_php/node_modules/css-loader/lib/loader.js:31:18)
    at /Users/leaddev/mnt/multiclient_php/node_modules/css-loader/lib/processCss.js:222:4
    at <anonymous>
    at runMicrotasksCallback (internal/process/next_tick.js:121:5)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

 error  in ./node_modules/startbootstrap-sb-admin-2/vendor/bootstrap/scss/bootstrap.scss

Module build failed: Unclosed block (229:4)

  227 |   padding-top: .75rem;
  228 |   padding-bottom: .75rem;
> 229 |   color: #6c757d;
      |    ^
  230 |   text-align: left;
  231 |   caption-side: bottom;
  232 | }

 @ ./node_modules/startbootstrap-sb-admin-2/vendor/bootstrap/scss/bootstrap.scss 4:14-181
 @ ./assets/js/app.js

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [encore] Error 2
nvaken commented 4 years ago

I've encountered this problem as well, but am not using this particular module and using Bootstrap in my own project. Somehow my Webpack Encore project is unable to compile Bootstrap's SCSS...

jonathangreco commented 4 years ago

So you say it's coming from bootstrap with webpack encore thanks !

nvaken commented 4 years ago

Yeah, I guess so!

Edit: FWIW, my setup even generates this error while I've commented out all custom SCSS and only am including @import "~bootstrap/scss/bootstrap";.

Edit 2: Even more funky, if I'm using my standalone sass compiler, I'm not experiencing any issues when using a relative path to the required bootstrap package @import "../../node_modules/bootstrap/scss/bootstrap.scss";. So this seems to be a problem in Encore? Or something in the config maybe.

jonathangreco commented 4 years ago

Hey! What about posting an issue in bootstrap's repo then or symfony-encore depends on your guesses ? Your tests are more advanced than mine to write a better issue.

If you don't mind.

nvaken commented 4 years ago

Agreed, this probably does not belong in this repo, though I'm having the feeling that this might be a implementation problem and maybe not even related to any external package. Therefor I'm thinking we might have the same implementation mistake. In any case; I don't think this is a bootstrap issue.

But, I'll postpone any response to this issue until I have anything of use for this package.

FWIW: This issue seems related.

nvaken commented 4 years ago

Updating @symfony/webpack-encore and all packages that break after that seem to have fixed the problem for me.

jonathangreco commented 4 years ago

thanks for the feedback on this one :) have fun