Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octoicons not loaded #4

Open
alexbeletsky opened this issue Oct 12, 2016 · 3 comments
Open

Octoicons not loaded #4

alexbeletsky opened this issue Oct 12, 2016 · 3 comments

Comments

@alexbeletsky
Copy link

I installed the library and configured webpack according to documentation. But if I try to use the icon, what I see is,

screenshot 2016-10-12 16 23 44

The code,

        <td>
          <Octicon name="triangle-down" />
          <Octicon name="triangle-up" />
        </td>

Webpack.js

  module: {
    loaders: [ {
      test: /\.js$/,
      loaders: [ 'babel' ],
      exclude: /node_modules/
    }, {
      test: /\.(css|scss)$/,
      loader: 'style!css?sourceMap!sass?sourceMap'
    }, {
      test: /\.(png|jpg|gif)$/,
      loader: 'file-loader?name=images/[name].[ext]'
    }, {
      test: /\.(otf|eot|svg|ttf|woff|woff2).*$/,
      loader: 'url?limit=8192'
    } ]
  },

I tried both,

import 'octicons/octicons/octicons.css';

And in scss

@import 'octicons/octicons/octicons.css';

Nothing helps.

I don't understand how your library is actually loading octicons styles. Neither lib or demo app loads it. How should it work?

@HoneyryderChuck
Copy link

+1 here, finding the same issue with Webpack 2.

@HoneyryderChuck
Copy link

I'm suspecting it has something to do with CORS. I'm seeing the woff file being requested, but I see the redirection error page, which means that it couldn't reach it. I'm also setting a public path to the assets (/assets), and that's not to be seen in the woff url.

@afkatja
Copy link

afkatja commented Nov 28, 2017

@alexbeletsky note that in Webpack 2, you need to explicitly state the -loader suffix, like so:

{
      test: /\.(otf|eot|svg|ttf|woff|woff2).*$/,
      loader: 'url-loader?limit=8192'
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants