medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
23.9k stars 2.32k forks source link

The documentation page and medusa backend and frontend will crash #7738

Open Snorlax-Chan opened 1 month ago

Snorlax-Chan commented 1 month ago

Preliminary Checks

Issue Summary

lo siguiente es el error en consola: main.3b555fb1.js:2 DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. at lc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1466848) at gc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1472000) at yc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1469075) at bc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468757) at yc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468870) at bc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468757) at yc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468870) at bc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468757) at yc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468870) at bc (https://docs.medusajs.com/assets/js/main.3b555fb1.js:2:1468757) mo @ main.3b555fb1.js:2 VM235:168 Uncaught TypeError: Cannot read properties of undefined (reading 'gzip') at dp.ph (eval at xhr.onreadystatechange (overview:430:9), :168:470) at rm.flush (eval at xhr.onreadystatechange (overview:430:9), :70:138) at rm.eval (eval at xhr.onreadystatechange (overview:430:9), :66:445) at Wd (m=elconf:524:469) at .k.dispatchEvent (m=el_conf:523:373) at Xl.tick (eval at xhr.onreadystatechange (overview:430:9), :65:214) at eval (eval at xhr.onreadystatechange (overview:430:9), :64:349)

How can this issue be resolved?

1.The same issue also appears on the dashboards created by Medusa and on Storefront pages. You just need to use Google Chrome or Microsoft Edge, and enable their built-in automatic webpage translation. After browsing for a while or clicking a few times (the frequency of occurrence is uncertain, sometimes it happens quickly, other times it might take ten minutes or more), the same webpage error appears: ‘Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.’

Are you interested in working on this issue?

Snorlax-Chan commented 1 month ago

I've discovered a possible cause of the issue. Please review to see if it can help resolve the problem.Also, because the previous answer was closed, I opened a new one @shahednasser If anyone stumbles upon this problem while a page is being translated in Google Chrome, it's likely it has something to do with this:

https://github.com/facebook/react/issues/11538

shahednasser commented 3 weeks ago

Hey @Snorlax-Chan , I'm trying to reproduce this issue in the documentation but I'm not able to. can you give me the exact steps you're following + which page it's occurring on? Would be good to get a screen recording too

shahednasser commented 3 weeks ago

Just investigated this issue a bit and i can see the trace in development. Looks like the main problem is with React Tooltip as google tries to translate the tooltip the same time you it's being shown.

Will spend some time trying to see if this is something we can resolve. If not, then the fix would probably be to disable using Google Translation to avoid this issue, as it's not high priority.

Snorlax-Chan commented 3 weeks ago

刚刚调查了一下这个问题,我可以看到开发中的踪迹。看起来主要问题出在React Tooltip上,因为谷歌试图在显示工具提示的同时翻译它。

我们会花一些时间尝试看看我们能否解决这个问题。如果不能,那么解决办法可能是禁用 Google 翻译来避免这个问题,因为它的优先级不高。

I'm glad you reproduced it. Is there a way to prevent it from crashing when errors occur? For store or blog pages, once the customer uses translation, the web page will crash. However, the popularity of Google Translate is too high. I noticed that other nextjs are frameworks. This problem does not seem to occur on websites

shahednasser commented 3 weeks ago

Like I mentioned, the issue is due to the use of react tooltip, which we use a lot in the documentation. Not sure if there's an easy fix unfortunately.

Snorlax-Chan commented 2 weeks ago

Like I mentioned, the issue is due to the use of react tooltip, which we use a lot in the documentation. Not sure if there's an easy fix unfortunately.

Thanks for the reply and looking up the issue, I will try to avoid using

shahednasser commented 1 week ago

Hey guys, I've opened a PR with a workaround that doesn't translate tooltips but ensures the page doesn't crash. Once it's merged, you can start using google translate with the docs again.