azureazure-devopsazure-devops-rest-apiazure-devops-extensions

Azure Devops Extension is no longer loading font file for icons


I've had a custom devops extension published for a few years now and randomly yesterday while making some changes we noticed that the icons do not load anymore. In the console log we see the following warnings

Failed to decode downloaded font: our_test_server_urls/_apis/public/gallery/publisher/{our_publisher_name}/extension/{extensionId/{extension_version}/assetbyname/dist/94fb5f9747cd4dcd0331.woff2

OTS parsing error: invalid sfntVersion: 1836016757

The changes we've made should not impact our font loading. Additionally I pulled down the production branch and ran that code locally and we get the same errors. But in our actual production extension the icons are loading fine. I really want to push these updates out but if the icons aren't going to load I can't do this.


Solution

  • There seems to be something different with how the .woff2 file is being built using webpack.

    Try updating your rule from:

    {
        test: /\.woff(2)$/,
        use: [{
            loader: 'base64-inline-loader'
        }]
    },
    

    to:

    {
        test: /\.woff2?$/i,
        type: 'asset/resource',
        dependency: { not: ['url'] },
    }
    

    This should fix the icon issue.