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.

Meteor 1.4: Doesn't load fonts

See original GitHub issue

Hi, having some trouble with the Materialize package on Meteor 1.4. The Roboto font files aren’t found, I get a 404 error.

Example:

http://localhost:3000/packages/materialize_materialize/fonts/roboto/Roboto-Medium.woff2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
devarthurribeirocommented, Sep 2, 2016

Put this code into your main.css:

@font-face { font-family: “Roboto”; src: local(Roboto Thin), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Thin.eot”); src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Thin.eot?”) format(“embedded-opentype”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Thin.woff2”) format(“woff2”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Thin.woff”) format(“woff”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Thin.ttf”) format(“truetype”); font-weight: 200; }

@font-face { font-family: “Roboto”; src: local(Roboto Light), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Light.eot”); src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Light.eot?”) format(“embedded-opentype”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Light.woff2”) format(“woff2”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Light.woff”) format(“woff”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Light.ttf”) format(“truetype”); font-weight: 300; }

@font-face { font-family: “Roboto”; src: local(Roboto Regular), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Regular.eot”); src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Regular.eot?”) format(“embedded-opentype”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Regular.woff2”) format(“woff2”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Regular.woff”) format(“woff”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Regular.ttf”) format(“truetype”); font-weight: 400; }

@font-face { font-family: “Roboto”; src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Medium.eot”); src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Medium.eot?”) format(“embedded-opentype”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Medium.woff2”) format(“woff2”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Medium.woff”) format(“woff”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Medium.ttf”) format(“truetype”); font-weight: 500; }

@font-face { font-family: “Roboto”; src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Bold.eot”); src: url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Bold.eot?”) format(“embedded-opentype”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Bold.woff2”) format(“woff2”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Bold.woff”) format(“woff”), url(“packages/materialize_materialize/dist/fonts/roboto/Roboto-Bold.ttf”) format(“truetype”); font-weight: 700; }

8reactions
diegonccommented, Jul 27, 2016

Ok, in the meantime I’ve done the following to workaround this issue (because I need the autocomplete feature 😄):

// Temporary workaround for materialize fonts
WebApp.connectHandlers.use("/packages/materialize_materialize/fonts", function (req, res) {
    const url = req.originalUrl.replace("/fonts/", "/dist/fonts/");
    res.statusCode = 301;
    res.setHeader("Location", url);
    res.end();
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Meteor npm install font-awesome, cannot find module ...
I am using meteor 1.4.1.1 with NPM ...
Read more >
browser-policy | Meteor API Docs
With this starter policy, your app's client code will be able to load content (images, scripts, fonts, etc.) only from its own origin,...
Read more >
Writing Atmosphere Packages - Meteor 1.5 - W3cubDocs
The main function of an Atmosphere package is to contain source code (JS, CSS, and any transpiled languages) and assets (images, fonts, and...
Read more >
Chapter 1. A better way to build apps - Meteor in Action
This book is about a Meteor that impacts web development, but it doesn't ... page load all JavaScript, styles, and static assets like...
Read more >
Getting Started with Meteor and Onsen UI | by Fran Dios
As of Meteor 1.4, we are able to import CSS from node_modules folder directly ... Fonts and icons won't be loaded in the...
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