You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error message when running runtime-plugins/control-sharing example:
Uncaught TypeError: Cannot read properties of undefined (reading 'filter')
Cause
control-share assumes that instance.options.shared[pkgName] is object, not an array of object
typo in js version of control-share - store.name versus runtimeStore.store
Workaround
Use runtimeStore variable, use options.shared[pkgName] as array, stick to index 0
args.resolver=function(){if(!overrides[runtimeStore.name]){returnoriginalResolver();}constoverrideVersion=overrides[runtimeStore.name][pkgName];constmatchingInstance=GlobalFederation.__INSTANCES__.find(instance=>{returninstance.options.shared[pkgName].some(sharedPackage=>sharedPackage.version===overrideVersion,);});if(matchingInstance){constcurrent=shareScopeMap[scope][pkgName][version],override=matchingInstance.options.shared[pkgName][0];//TODO: which element should i pick?if(current.from===override.from)returncurrent;constoriginInstance=GlobalFederation.__INSTANCES__.find(instance=>{returninstance.options.name===current.from;});originInstance.options.shared[pkgName].forEach(sharedPackage=>{sharedPackage.useIn.filter(i=>i!==runtimeStore.name);});shareScopeMap[scope][pkgName][version]=matchingInstance.options.shared[pkgName][0];//TODO: which element should i pick?if(!shareScopeMap[scope][pkgName][version].useIn.includes(runtimeStore.name)){shareScopeMap[scope][pkgName][version].useIn.push(runtimeStore.name);}returnmatchingInstance.options.shared[pkgName][0];//TODO: which element should i pick?;}else{console.log('No matching instance found for overrideVersion',overrideVersion);}returnoriginalResolver();};returnargs;},
Question
How to determine correct index in options.shared[pkgName]?
The text was updated successfully, but these errors were encountered:
Problem
Error message when running
runtime-plugins/control-sharing
example:Uncaught TypeError: Cannot read properties of undefined (reading 'filter')
Cause
control-share
assumes thatinstance.options.shared[pkgName]
is object, not an array of objectstore.name
versusruntimeStore.store
Workaround
Use runtimeStore variable, use
options.shared[pkgName]
as array, stick to index 0Question
How to determine correct index in
options.shared[pkgName]
?The text was updated successfully, but these errors were encountered: