Joost Döbken
Joost Döbken

Reputation: 4017

Awesome fonts failed to decode in Meteor+react

During my implementation of react-widgets in Meteor+React, I am able to get the datetime object. But somehow the fontawesome are not loaded correctly, so the datetime object looks now like:

enter image description here

The console gives me the following warning:

Failed to decode downloaded font: http://localhost:3000/fonts/rw-widgets.ttf?v=4.1.0

OTS parsing error: invalid version tag

current implementation

I imported the required css file in main.js:

import 'react-widgets/dist/css/react-widgets.css';

In my app I imported the date time picker, nothing fancy here.

import { DateTimePicker } from 'react-widgets';
...
<DateTimePicker
    ref="startedAt"
    format={'YYYY/MM/DD HH:mm'}
    timeFormat={'HH:mm'}
    step={1}
    className='form-control'
    defaultValue={startDate}
    culture='en' />

So probably I forgot something straight forward?

Upvotes: 1

Views: 424

Answers (1)

Kapil
Kapil

Reputation: 166

  1. Create a public folder in your project folder, which has client, server, imports and other folders.
  2. copy fonts and img folders from "your project folder/node_modules/react-widgets/dist/" to your public folders above. After restart of your server, you should not see the warnings you have mentioned.

Upvotes: 4

Related Questions