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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to decode downloaded font when referencing font stylesheets directly from node_modules #2754

Closed
r0skar opened this issue Mar 9, 2019 · 2 comments

Comments

@r0skar
Copy link

r0skar commented Mar 9, 2019

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

// package.json
{
  "dependencies": {
    "inter-ui": "^3.3.4",
    "parcel-bundler": "^1.12.0"
  },
  "scripts": {
    "parcel": "parcel src/index.html"
  }
}
<!-- src/index.html -->
<!DOCTYPE html>
<html>
  <head>
    <title>parcel-fonts</title>
    <link rel="stylesheet" href="../node_modules/inter-ui/inter.css">
    <style>
      body {
        font-family: 'Inter';
      }
    </style>
  </head>
  <body>
    <h1>parcel-fonts</h1>
  </body>
</html>

馃 Expected Behavior

Display text with the correct font.

馃槸 Current Behavior

Font is not being used and Chrome outputs following warnings:

Failed to decode downloaded font: http://localhost:1234/parcel-fonts/Inter-Bold.5dcf194e.woff2
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:1234/parcel-fonts/Inter-Bold.65dad7f9.woff
OTS parsing error: invalid version tag

馃拋 Possible Solution

Not really a solution, but the code above works just fine, when the fonts are placed in the src folder and referenced like this: <link rel="stylesheet" href="inter-ui/inter.css">

馃實 Your Environment

Software Version(s)
Parcel 1.12.0
Node 11.10.0
yarn 1.13.0
Operating System Linux 4.20
@krnlde
Copy link

krnlde commented Mar 11, 2019

Can confirm with Parcel 1.12.0, in 1.11.0 it works.

@mischnic
Copy link
Member

Fixed by #2740

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

No branches or pull requests

3 participants