[Meteor 1.6.1] Bootstrap & SourceMaps, Font-Awesome & Font Files, NPM

I have been using the ‘alexwine:bootstrap-4’ and ‘fortawesome:fontawesome’ Atmosphere packages.
Upon updating from 1.6.0 to 1.6.1 I began getting new console warnings:
DevTools failed to parse SourceMap: http://localhost:3000/packages/popper.js.map
DevTools failed to parse SourceMap: http://localhost:3000/bootstrap.css.map

I am assuming the cause is the change in the 1.6.1 release in the standard-minifier-css to postcss, from the older css-parse and css-stringify packages.

I have wanted to move bootstrap and font-awesome over to NPM so I removed the ‘alexwine:bootstrap-4’ and ‘fortawesome:fontawesome’ Atmosphere packages and began NPMing:

npm install --save bootstrap
npm install --save jquery
npm install --save popper.js
npm install --save font-awesome

Now to get these into the project I added a few lines to
\imports\startup\client\index.js :

import 'font-awesome/css/font-awesome.css';
import 'bootstrap/dist/css/bootstrap.css';
import $ from 'jquery';
import 'bootstrap';

Meteor.startup(() => {
    render(<App />, document.getElementById('react-root'));
    $('[data-toggle="tooltip"]').tooltip(); //Enable Bootstrap ToolTips Everywhere

Bootstrap renders and the ToolTips work! Unfortunately I still was getting the SourceMap warnings, and I was now also getting font errors.
Failed to decode downloaded font: http://localhost:3000/fonts/fontawesome-webfont.woff2?v=4.7.0
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/fontawesome-webfont.woff?v=4.7.0
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/fontawesome-webfont.ttf?v=4.7.0
OTS parsing error: invalid version tag

To resolve the original warnings I copied the map files files into the public folder.
node_modules\bootstrap\dist\css\bootstrap.css.map to public
node_modules\popper.js\dist\popper.js.map to public\packages

To resolve the font errors I copied the font-awesome fonts folder into the public folder.
node_modules\font-awesome\fonts to public\fonts

I have added NPM scripts to automate this :

  "scripts": {
    "start": "meteor",
    "copy-font-awesome-fonts": "xcopy node_modules\\font-awesome\\fonts public\\fonts /s /y",
    "copy-bootstrap-sourcemap": "xcopy node_modules\\bootstrap\\dist\\css\\bootstrap.css.map public /y",
    "copy-popper-sourcemap": "xcopy node_modules\\popper.js\\dist\\popper.js.map public\\packages /y"

I also added a few lines to the .gitignore :


This has resolved all of the console messages, but I don’t feel that this is the most correct solution.
It feels like the build tool should pull these in automatically, yes?
I am hoping someone here knows the most correct resolution to this.

Thanks, Tim


It could be a little bit cleaner if you add thoses commands into a postInstall script, so it’s run whenever you do a npm install. Also, thoses are windows scripts, they don’t work for linux/mac.

What I’ve been doing is adding a vendor-imports.scss file in my client folder which defines any variable overrides for bootstrap and then imports the scss files from the bootstrap module like so:

// Bootstrap overrides:
$border-radius: 0;
$brand-primary: $blue;
$brand-warning: $fadedOrange;
$brand-danger:  $coral;
$headings-font-weight: 700;
$headings-line-height: 1.1;
$headings-color:       inherit;

// Bootstrap's icon font path:
$icon-font-path: "/fonts/";

@import '{}/node_modules/bootstrap/scss/bootstrap';

// Font Awesome's icon font path:
$fa-font-path:  "/fonts/";

@import "{}/node_modules/font-awesome/scss/variables";
@import "{}/node_modules/font-awesome/scss/mixins";
@import "{}/node_modules/font-awesome/scss/path";
@import "{}/node_modules/font-awesome/scss/core";
@import "{}/node_modules/font-awesome/scss/larger";
@import "{}/node_modules/font-awesome/scss/fixed-width";
@import "{}/node_modules/font-awesome/scss/list";
@import "{}/node_modules/font-awesome/scss/bordered-pulled";
@import "{}/node_modules/font-awesome/scss/animated";
@import "{}/node_modules/font-awesome/scss/rotated-flipped";
@import "{}/node_modules/font-awesome/scss/stacked";
@import "{}/node_modules/font-awesome/scss/icons";
@import "{}/node_modules/font-awesome/scss/screen-reader";

The font-awesome imports are separated because I had issues when importing the main entry point for some reason ('{}/node_modules/font-awesome/scss/font-awesome.scss';)

This means that Meteor’s build tool will compile all of bootstrap and your own styles together and build sourcemaps for them all. You will still need to copy the fonts into public/fonts/ yourself or with a script though

I’ve got the same problem with bootstrap:

DevTools failed to parse SourceMap: http://localhost:3000/packages/bootstrap.js.map
3DevTools failed to parse SourceMap: http://localhost:3000/bootstrap.css.map

I’m using alexwine:bootstrap-4 … reading this thread I’m a bit confused. Is there a simple way to solve my problem like removing this package and using one from npm through meteor npm?

I tried with:

meteor remove alexwine:bootstrap-4
meteor npm install bootstrap

the I got this message:

npm WARN bootstrap@4.0.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.0.0 requires a peer of popper.js@^1.12.9 but none is installed. You must install peer dependencies yourself.

I installed jquery and popper with meteor npm install, then refreshed but nothign worked.

I don’t understand why.

1 Like

For the JS, I’ve been importing the bootstrap bundle:

import 'bootstrap/dist/js/bootstrap.bundle';

Which includes popper. I’m using Blaze, so jQuery is already available from the meteor package

EDIT: Meteor’s jquery doesn’t get loaded properly by bootstrap, so you will still need to install it via npm

Just a heads up to everyone here - when Meteor 1.6.2 drops you’ll be able to use symbolic links to node_modules directories in your /public directory, and have the linked to content automatically copied over at production build time. So you can just symlink in the font-awesome fonts (instead of using a post install script), and everything should just work. For more info see:


@hwillson I’m trying to load fonts from an npm module and I noticed you said that you are able to create symlinks for this now in a production build, does that mean that while in development you can’t use this approach? Should I copy the font files manually in dev and then just leave the symlink for prod release?

The symlinks will work fine in development as well.

Note that if you have any Windows devs, symlinks in git are hell for Windows, so you will probably want to use a post-install script to create symlinks anyway


I tried doing ln -s ./node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf ./public/fonts but it didn’t work. I had to manually copy the ttf file

I use mac btw

because symbolic links only store a path, it must be relative to the target location.
So in your case you should start from the public/fonts/ directory and make the link from there:

cd public/fonts
ln -s ../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf

Edit: More details

If you inspect the link with ls -al it will show you the path it refers to. You can also use file to check what it’s pointing to:

# In project root
$ ln -s ./node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf ./public/fonts
$ ls -al ./public/fonts
lrwxr-xr-x   1 username  staff    63  6 Jun 12:00 FontAwesome.ttf -> ./node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf
# Note the relative path in public/fonts
$ file public/fonts/FontAwesome.ttf
public/fonts/FontAwesome.ttf: broken symbolic link to ./node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf
# And file tells you directly that the symlink is broken

# Lets try with a different relative path:
$ rm public/fonts/FontAwesome.ttf # cleanup
$ cd public/fonts
# Now we're in the target folder, so the relative path will make sense
$ ln -s ../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf
$ ls -al
lrwxr-xr-x   1 username  staff    67  6 Jun 12:06 FontAwesome.ttf -> ../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf
# That's looking better
$ file FontAwesome.ttf
FontAwesome.ttf: TrueType font data
# And file can now resolve the correct file and return information about it
1 Like

makes totally sense, I was not looking at it very clear, my bad :tired_face:

thanks @coagmano for the help!

Just wanted to add the method I use for adding font-awesome-free 5.8 which might be helpful to some.
I simply create an npm post install script.


cp -R node_modules/@fortawesome/fontawesome-free/webfonts ./public/

You will want to change the execute permission on that file chmod +x postinstall.sh

Then add a line to package.json where it gets called automatically after an npm install

"scripts": {
    "start": "meteor run",
    "test": "meteor test --once --driver-package meteortesting:mocha",
    "postinstall": "./postinstall.sh"

Add public/webfonts to your git ignore.

Finally, add import '@fortawesome/fontawesome-free/css/all.css' to your main.js file.

Happy days…I hope.

1 Like

you are right! help me twice,very good!