Bit: Error when importin webfonts in the playground

Created on 26 Mar 2019  路  8Comments  路  Source: teambit/bit

Expected Behavior

Webfonts hosted in a Bit package get rendered properly

Actual Behavior

The browser complains with the following error and the font doesn't get rendered (the character is shown as a square):

Failed to decode downloaded font: https://<chunk>.capsule.ws/static/media/fa-regular-400.<chunk>.woff
OTS parsing error: incorrect file size in WOFF header

Steps to Reproduce the Problem

I created 2 public components in Bit to show the issue:

(I apologize for the big images)

  1. go to https://bit.dev/fabgallo/tests/issue/hello-world
  2. you will notice the following when the playground renders the component
    Image 2019-03-26 at 8 29 36 PM
  3. when launched locally, everything works and the fonts are downloaded and rendered properly from Bit
    image

Specifications

  • Bit version: 14.0.3
  • Node version: 10.15.2
  • npm / yarn version: yarn 1.13.0
  • Platform: macOS Mojave 10.14.3
  • Bit compiler (include version): typescript v.0.0.5 (https://bit.dev/bit/envs/compilers/typescript)
  • Bit tester (include version): n/a
arebit.dev areplayground typbug

Most helpful comment

thanks @guysaar223 !!
I went back to my demo component and indeed it works correctly now. I will try with my other private components soon and report back in case of issues.

All 8 comments

@fabgallo Thanks for reporting this.
I'll investigate this issue and post an update.

@fabgallo Quick update:
It looks like the css file is being cut in half. (which cause that in the playground you have missing definitions).
This is not something about your css or component, I notice that long examples are being cut as well.
I'm still trying to understand where exactly in the pipe it's being cut.
I'll post my findings here.

seems to be related to https://github.com/facebook/create-react-app/issues/923
they say the generated url could be faulty, but I checked with Postmen and it seems to be the file from the component.

so I am thinking it's a Loader issue inside the CreateReactApp in the Capsule?

@KutnerUri It's working with regular create-react-app. And the one in the capsule is no different I think.
I'm not sure it's about the capsule.

Any news on this one? I'm getting the same error, thus breaking my components on playground.

Hi, @fjckls
I found the problem, we are working to fix it.

Guy

@fabgallo @fjckls @KutnerUri
fixed :)

thanks @guysaar223 !!
I went back to my demo component and indeed it works correctly now. I will try with my other private components soon and report back in case of issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rap0so picture rap0so  路  13Comments

AlexanderKaran picture AlexanderKaran  路  10Comments

ranm8 picture ranm8  路  14Comments

itaymendel picture itaymendel  路  16Comments

FredyC picture FredyC  路  20Comments