question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

๐Ÿ› bootsrap 4.0.0 with PostCSS

See original GitHub issue

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

package.json

  "dependencies": {
    "autoprefixer": "7.2.5",
    "bootstrap": "4.0.0",
    "node-sass": "4.7.2",
    "parcel-bundler": "1.5.0",
    "postcss-modules": "1.1.0",
    "prismjs": "1.10.0"
  }

.postsrc

{
  "modules": true,
  "plugins": {
    "autoprefixer": {
      "grid": true
    }
  }
}

๐Ÿค” Expected Behavior

parcel build index.html working like parcel index.html

๐Ÿ˜ฏ Current Behavior

ร— C:\Users\jaribu\Desktop\dev\tf\node_modules\bootstrap\dist\css\bootstrap.min.css:undefined:undefined: Unknown browser major at error (C:\Users\jaribu\Desktop\dev\tf\node_modules\browserslist\index.js:37:11) at Function.browserslist.checkName (C:\Users\jaribu\Desktop\dev\tf\node_modules\browserslist\index.js:320:18) at Function.select (C:\Users\jaribu\Desktop\dev\tf\node_modules\browserslist\index.js:438:37) at C:\Users\jaribu\Desktop\dev\tf\node_modules\browserslist\index.js:207:41 at Array.forEach (<anonymous>) at browserslist (C:\Users\jaribu\Desktop\dev\tf\node_modules\browserslist\index.js:196:13) at Browsers.parse (C:\Users\jaribu\Desktop\dev\tf\node_modules\cssnano\node_modules\autoprefixer\lib\browsers.js:44:14) at new Browsers (C:\Users\jaribu\Desktop\dev\tf\node_modules\cssnano\node_modules\autoprefixer\lib\browsers.js:39:28) at loadPrefixes (C:\Users\jaribu\Desktop\dev\tf\node_modules\cssnano\node_modules\autoprefixer\lib\autoprefixer.js:56:18) at plugin (C:\Users\jaribu\Desktop\dev\tf\node_modules\cssnano\node_modules\autoprefixer\lib\autoprefixer.js:62:18) Unknown error from PostCSS plugin. Your current PostCSS version is 6.0.16, but autoprefixer uses 5.2.18. Perhaps this is the source of the error below. (node:8272) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): BrowserslistError: Unknown browser major (node:8272) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will termina te the Node.js process with a non-zero exit code.

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

import 'prismjs'
import './node_modules/prismjs/plugins/autolinker/prism-autolinker.js'
import './node_modules/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js'

import './node_modules/bootstrap/dist/css/bootstrap.css'

๐ŸŒ Your Environment

Software Version(s)
Parcel 1.5.0
Node 8.7.0
npm/Yarn 5.6.0
Operating System Windows 7

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
qunabucommented, Jan 27, 2018

This does work for me in index.scss, note the :global (https://github.com/css-modules/css-modules#usage-with-preprocessors)

:global {

    @import "base/bootstrap-config"; // bootstrap overrides

    @import "./node_modules/bootstrap/scss/bootstrap.scss";

}
6reactions
andyfangdzcommented, May 10, 2018

@samsch Actually, I can confirm that I have this issue without any PostCSS config as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack - Bootstrap
Learn how to include Bootstrap in your project using Webpack 3. Installing Bootstrap. Install bootstrap as a Node.js module using npm. Importing JavaScript....
Read more >
Migrating to v4 - Bootstrap
Rewrote component with flexbox. Given move to flexbox, alignment of dismiss icons in the header is likely broken as we're no longer using...
Read more >
Introduction - Bootstrap
Get started with Bootstrap, the world's most popular framework for building responsive, mobile-first sites, with jsDelivr and a template starter page.
Read more >
Download - Bootstrap
Download ready-to-use compiled code for Bootstrap v4.0.0 to easily drop into your project, which includes: Compiled and minified CSS bundles (see CSS filesย ......
Read more >
Angular build error with bootstrap 4.0.0 - Stack Overflow
I saw a lot of comments about importing bootstrap instead of including it in the styles array. That felt a little bit of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found