qiankun子应用内 报错Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. #49009
Labels
🤔 Need Reproduce
We cannot reproduce your problem
Reproduction link
https://baijiahao.baidu.com/builder/rc/edit?type=news
Steps to reproduce
webpack://fe-react/node_modules/qiankun/es/sandbox/patchers/dynamicAppend/common.js@call第129行,第40列
124 var rawDOMAppendOrInsertBefore = opts.rawDOMAppendOrInsertBefore,
125 isInvokedByMicroApp = opts.isInvokedByMicroApp,
126 containerConfigGetter = opts.containerConfigGetter;
127
128 if (!isHijackingTag(element.tagName) || !isInvokedByMicroApp(element)) {
129 return rawDOMAppendOrInsertBefore.call(this, element, refChild);
130 }
131
132 if (element.tagName) {
133 var containerConfig = containerConfigGetter(element);
134 var appName = containerConfig.appName,
webpack://cheetahui/node_modules/rc-util/es/Dom/dynamicCSS.js@第74行,第18列
69 // Ignore style which priority less then new style
70 var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
71 return priority >= nodePriority;
72 });
73 if (existStyle.length) {
74 container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
75 return styleNode;
76 }
77 }
78
79 // Use
insertBefore
asprepend
webpack://cheetahui/node_modules/rc-util/es/Dom/dynamicCSS.js@injectCSS第145行,第16列
140 if (existNode.innerHTML !== css) {
141 existNode.innerHTML = css;
142 }
143 return existNode;
144 }
145 var newNode = injectCSS(css, option);
146 newNode.setAttribute(getMark(option), key);
147 return newNode;
148}
webpack://cheetahui/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js@styleStr第337行,第30列
332 }));
333 });
334
335 // ==================== Inject Style ====================
336 // Inject style
337 var style = updateCSS(styleStr, styleId, mergedCSSConfig);
338 style[CSS_IN_JS_INSTANCE] = cache.instanceId;
339
340 // Used for
useCacheToken
to remove on batch when token removed341 style.setAttribute(ATTR_TOKEN, tokenKey);
342
webpack://cheetahui/node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js@onCacheEffect第60行,第58列
55 }
56 var cacheContent = cacheEntity[1];
57
58 // Remove if no need anymore
59 useCompatibleInsertionEffect(function () {
60 onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);
61 }, function (polyfill) {
62 // It's bad to call build again in effect.
63 // But we have to do this since StrictMode will call effect twice
64 // which will clear cache on the first time.
65 buildCache(function (_ref3) {
webpack://cheetahui/node_modules/@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.js@renderEffect第30行,第4列
25 * will use
useInsertionEffect
if React version >= 18,26 * otherwise use
useInsertionEffectPolyfill
.27 */
28var useCompatibleInsertionEffect = useInsertionEffect ? function (renderEffect, effect, deps) {
29 return useInsertionEffect(function () {
30 renderEffect();
31 return effect();
32 }, deps);
33} : useInsertionEffectPolyfill;
34export default useCompatibleInsertionEffect;
What is expected?
不报错
What is actually happening?
报错Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
The text was updated successfully, but these errors were encountered: