I’m doing what I expect to be a very simple assetbundle build script, but when I run it, it never finishes, even after hours of waiting. Anyone seen this?
One important detail: it only seems to happen when targeting BuildTarget.WebGL.

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
public class CreateAssetBundles
{
[MenuItem("Assets/Build AssetBundles")]
private static void BuildAllAssetBundles()
{
string bundleFolder = "Assets/AssetBundles";
if (!Directory.Exists(bundleFolder))
{
Directory.CreateDirectory(bundleFolder);
}
BuildPipeline.BuildAssetBundles(bundleFolder, BuildAssetBundleOptions.None, BuildTarget.WebGL);
}
}
The assetbundle build never completes, and can’t be stopped without exiting the editor completely. Notably, the assetbundles themselves do appear to build correctly, even though the build process continues.
I’ve tried updating my video driver, rebooting the whole machine multiple times, deleting the entire Library folder, etc.
For the record, I’m on Windows 10, with Unity 2020.3.20f1 LTS.