{"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/290d5ab72cc1102813fbc0406fb186ceadabc340/src/mono/browser/runtime/loader/config.ts#L157-L193","documentation":"Thrown by normalizeConfig while iterating the deprecated config.assets array, when an asset's behavior string does not match any known case (assembly, pdb, resource, icu, symbols, vfs, dotnetwasm, js-module-*). It signals a malformed or unrecognized asset entry, typically from a hand-authored or version-mismatched config using the legacy assets format.","triggerScenarios":"Produced during config normalization when config.assets contains an entry whose `behavior` is an unknown/typo'd value (e.g. 'assembly ' with trailing space, 'resource2', or a value from a newer/older runtime version).","commonSituations":"Manually constructing monoConfig with an assets array and mistyping a behavior; using config.assets (deprecated) instead of config.resources; a config produced by a tool/SDK version that emits a behavior this older runtime does not understand.","solutions":["Use config.resources (the current format) instead of the deprecated config.assets array.","If you must use config.assets, correct the offending asset's behavior to one of: assembly, pdb, resource, icu, symbols, vfs, dotnetwasm, js-module-runtime, js-module-native, js-module-diagnostics, js-module-dotnet.","Regenerate the config with the matching SDK/runtime tooling so behaviors are emitted correctly."],"exampleFix":"// before: deprecated assets with a typo'd behavior\ndotnet.withConfig({\n  assets: [{ name: 'x.dll', behavior: 'assembly ' /* trailing space */ }]\n});\n\n// after: use the resources format\ndotnet.withConfig({\n  resources: { assembly: [{ name: 'x.dll', behavior: 'assembly' }] }\n});","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)) { /* fix or migrate to resources */ }\n}","typeGuard":"function isValidAssetBehavior(b: string): boolean {\n  return ['assembly','pdb','resource','icu','symbols','vfs','dotnetwasm','js-module-runtime','js-module-native','js-module-diagnostics','js-module-dotnet'].includes(b);\n}","tryCatchPattern":null,"preventionTips":["Prefer config.resources over the deprecated config.assets format.","Validate config with a schema check before boot.","Regenerate config with the matching SDK tooling after upgrades."],"tags":["config","assets","startup","deprecated"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}