{"record":{"id":"869e5146d0f592e8","repo":"dotnet/runtime","slug":"unexpected-behavior-asset-behavior-of-asset-a","errorCode":null,"errorMessage":"Unexpected behavior ${asset.behavior} of asset ${asset.name}","messagePattern":"Unexpected behavior (.+?) of asset (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mono/browser/runtime/loader/config.ts","lineNumber":175,"sourceCode":"                    toMerge.vfs = [asset as VfsAsset];\n                    break;\n                case \"dotnetwasm\":\n                    toMerge.wasmNative = [asset as WasmAsset];\n                    break;\n                case \"js-module-runtime\":\n                    toMerge.jsModuleRuntime = [asset as JsAsset];\n                    break;\n                case \"js-module-native\":\n                    toMerge.jsModuleNative = [asset as JsAsset];\n                    break;\n                case \"js-module-diagnostics\":\n                    toMerge.jsModuleDiagnostics = [asset as JsAsset];\n                    break;\n                case \"js-module-dotnet\":\n                    // don't merge loader\n                    break;\n                default:\n                    throw new Error(`Unexpected behavior ${asset.behavior} of asset ${asset.name}`);\n            }\n            deep_merge_resources(config.resources, toMerge);\n        }\n    }\n\n    if (config.debugLevel === undefined && BuildConfiguration === \"Debug\") {\n        config.debugLevel = -1;\n    }\n\n    if (config.virtualWorkingDirectory === undefined) {\n        config.virtualWorkingDirectory = browserVirtualAppBase;\n    }\n\n    if (!config.applicationEnvironment) {\n        config.applicationEnvironment = \"Production\";\n    }\n\n    // ActiveIssue https://github.com/dotnet/runtime/issues/75602","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/mono/browser/runtime/loader/config.ts#L157-L193","documentation":"Thrown by normalizeConfig in config.ts when processing the deprecated config.assets array: an asset's behavior field does not match any known case (assembly, pdb, resource, icu, symbols, vfs, dotnetwasm, js-module-runtime, js-module-native, js-module-diagnostics, js-module-dotnet). It indicates a boot configuration / mono-config.json with an unrecognized asset behavior, typically from a custom config or an asset produced by a different runtime version.","triggerScenarios":"Hand-authoring a mono-config.json with a typo or unsupported behavior value; merging configs from an incompatible runtime version; a tool producing assets with an unknown behavior.","commonSituations":"Migrating between runtime versions that changed the asset behavior vocabulary; writing a custom config that uses the legacy config.assets shape; copy-paste typos like 'assembly ' (trailing space) or 'icU'.","solutions":["Use the modern config.resources shape instead of the deprecated config.assets array.","If using config.assets, set behavior to one of the known values (assembly, pdb, resource, icu, symbols, vfs, dotnetwasm, js-module-runtime, js-module-native, js-module-diagnostics, js-module-dotnet).","Re-generate the config with the tooling matching your runtime version."],"exampleFix":"// before: unknown behavior\nconfig.assets = [{ name:'x', behavior:'foo' }];\n// after: use config.resources\nconfig.resources = { assembly: [{ name:'x', virtualPath:'x.dll' }] };","handlingStrategy":"validation","validationCode":"const knownBehaviors = new Set(['assembly','pdb','resource','icu','symbols','vfs','dotnetwasm','js-module-runtime','js-module-native','js-module-diagnostics','js-module-dotnet']);\nfor (const a of config.assets ?? [])\n  if (!knownBehaviors.has(a.behavior)) throw new Error(`unknown asset behavior ${a.behavior}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer config.resources over the deprecated config.assets.","Regenerate mono-config.json with the runtime version you ship.","Validate asset behavior values against the known set at startup."],"tags":["configuration","assets","startup","config"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}