Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mono/wasm/runtime/loader/blazor/_Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function setupModuleForBlazor(module: DotnetModuleInternal) {
return undefined;
};

module.downloadResource = downloadResource;
loaderHelpers.downloadResource = downloadResource; // polyfills were already assigned
module.disableDotnet6Compatibility = false;
}

Expand Down
20 changes: 12 additions & 8 deletions src/mono/wasm/runtime/loader/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ export async function mono_wasm_load_config(module: DotnetModuleInternal): Promi
}
if (loaderHelpers.diagnosticTracing) console.debug("MONO_WASM: mono_wasm_load_config");
try {
const resolveSrc = loaderHelpers.locateFile(configFilePath);
const configResponse = await loaderHelpers.fetch_like(resolveSrc);
const loadedAnyConfig: any = (await configResponse.json()) || {};
if (loadedAnyConfig.resources) {
await initializeBootConfig(BootConfigResult.fromFetchResponse(configResponse, loadedAnyConfig as BootJsonData), module);
if (loaderHelpers.config.startupOptions && loaderHelpers.config.startupOptions.loadBootResource) {
// If we have custom loadBootResource
await loadBootConfig(loaderHelpers.config, module);
} else {
const loadedConfig = loadedAnyConfig as MonoConfigInternal;
if (loaderHelpers.config.startupOptions && loaderHelpers.config.startupOptions.loadBootResource) {
await loadBootConfig(loaderHelpers.config, module);
// Otherwise load using fetch_like
const resolveSrc = loaderHelpers.locateFile(configFilePath);
const configResponse = await loaderHelpers.fetch_like(resolveSrc);
const loadedAnyConfig: any = (await configResponse.json()) || {};
if (loadedAnyConfig.resources) {
// If we found boot config schema
await initializeBootConfig(BootConfigResult.fromFetchResponse(configResponse, loadedAnyConfig as BootJsonData), module);
} else {
// Otherwise we found mono config schema
const loadedConfig = loadedAnyConfig as MonoConfigInternal;
if (loadedConfig.environmentVariables && typeof (loadedConfig.environmentVariables) !== "object")
throw new Error("Expected config.environmentVariables to be unset or a dictionary-style object");
deep_merge_config(loaderHelpers.config, loadedConfig);
Expand Down