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

Failed to decode downloaded font ... error: invalid sfntVersion: 1702391919 #5343

Open
Ken-Taki opened this issue Sep 9, 2022 · 4 comments

Comments

@Ken-Taki
Copy link

Ken-Taki commented Sep 9, 2022

The loading of fonts in webpack seems to lead to decoding errors. Maybe the loaders, which are marked as deprecated, should be updated to the asset modules: https://webpack.js.org/guides/asset-modules/

Url-Loader: DEPREACTED for v5: please consider migrating to asset modules.
Source: https://github.com/webpack-contrib/url-loader

Found in Leanup 1.3.33

@deleonio
Copy link
Contributor

Hi @Ken-Taki,

do you have a suggestion for the coniguration?

Thx

@Ken-Taki
Copy link
Author

I think, this rule should work for fonts:
rules: [
...
{
test: /.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
...
]

@Ken-Taki
Copy link
Author

asset/resource emits a separate file and exports the URL. Previously achievable by using file-loader.

Source: https://webpack.js.org/guides/asset-modules/

@deleonio
Copy link
Contributor

Will be integrated in release 2.0.0-rc.73.

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

2 participants