Skip to content

[browser] single file JavaScript and custom loader #89510

Description

@elringus

Description

I'm attempting to run browser-wasm with a minimal custom config under .NET 8:

import { dotnet } from './dotnet.js'

const config = {
    "mainAssemblyName": "Test.dll",
    "assemblyRootFolder": "managed",
    "assets": [
	    {
	      "behavior": "dotnetwasm",
	      "name": "dotnet.native.wasm",
	    },
	    {
	      "behavior": "js-module-native",
	      "name": "dotnet.native.js",
	    },
	    {
	      "behavior": "js-module-dotnet",
	      "name": "dotnet.js",
	    },
	    {
	      "behavior": "js-module-runtime",
	      "name": "dotnet.runtime.js",
	    },
	    {
	      "behavior": "assembly",
	      "name": "System.Console.wasm",
	    },
	    {
	      "behavior": "assembly",
	      "name": "System.Linq.wasm",
	    },
	    {
	      "behavior": "assembly",
	      "name": "System.Private.CoreLib.wasm",
	    },
	    {
	      "behavior": "assembly",
	      "name": "Test.wasm",
	    }
    ]
};
const runtime = await dotnet.withConfig(config).create();

But getting nullref here: https://github.com/dotnet/runtime/blob/v8.0.0-preview.6.23329.7/src/mono/wasm/runtime/loader/assets.ts#L145C28

It worked in .NET 7 fine before.

Reproduction Steps

Publish browser-wasm and try running it with a custom config under "AppBundle" dir.

Full repro project with steps: https://github.com/Elringus/JSInteropTest

Expected behavior

No errors.

Actual behavior

Error in mono_download_assets: TypeError: pendingDownloadInternal is null

Regression?

Yes, it worked in .NET 7.

Known Workarounds

None.

Configuration

.NET v8.0.0-preview.6.23329.7
Windows 10
Local http server under AppBundle dir with serve under powershell.

Other information

No response

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions