Kaynağa Gözat

fix: merge radix vendor chunk into react to fix TDZ error

Radix UI has circular dependencies with React internals. Splitting them
into separate chunks caused "Cannot access 'bn' before initialization"
at runtime. Merging them into a single vendor-react chunk fixes the
initialization order.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tuanchris 4 ay önce
ebeveyn
işleme
8f687fdf56

+ 4 - 4
frontend/vite.config.ts

@@ -175,15 +175,15 @@ export default defineConfig({
       output: {
         manualChunks(id) {
           if (id.includes('node_modules')) {
-            if (id.includes('react-dom') || id.includes('/react/') || id.includes('react-router')) {
+            // Radix UI has circular dependencies with React internals,
+            // so they must share a chunk to avoid TDZ errors.
+            if (id.includes('react-dom') || id.includes('/react/') || id.includes('react-router') ||
+                id.includes('@radix-ui') || id.includes('@floating-ui') || id.includes('react-remove-scroll')) {
               return 'vendor-react'
             }
             if (id.includes('motion') || id.includes('framer-motion')) {
               return 'vendor-motion'
             }
-            if (id.includes('@radix-ui') || id.includes('@floating-ui') || id.includes('react-remove-scroll')) {
-              return 'vendor-radix'
-            }
             if (id.includes('@dnd-kit')) {
               return 'vendor-dnd'
             }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/index-D0JFYMt5.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-dnd-q9FzeT3W.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-motion-CK5zddn4.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-query-CKpBt6eI.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-radix-B9aLzj-s.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-react--zkW7TCA.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/assets/vendor-react-BUBGLCP9.js


+ 5 - 6
static/dist/index.html

@@ -58,12 +58,11 @@
           .catch(function() {});
       })();
     </script>
-    <script type="module" crossorigin src="/assets/index-DvzRKNdC.js"></script>
-    <link rel="modulepreload" crossorigin href="/assets/vendor-radix-B9aLzj-s.js">
-    <link rel="modulepreload" crossorigin href="/assets/vendor-react--zkW7TCA.js">
-    <link rel="modulepreload" crossorigin href="/assets/vendor-query-Do4U4P_7.js">
-    <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-CIuglpGI.js">
-    <link rel="modulepreload" crossorigin href="/assets/vendor-motion-BglLd8Or.js">
+    <script type="module" crossorigin src="/assets/index-D0JFYMt5.js"></script>
+    <link rel="modulepreload" crossorigin href="/assets/vendor-react-BUBGLCP9.js">
+    <link rel="modulepreload" crossorigin href="/assets/vendor-query-CKpBt6eI.js">
+    <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-q9FzeT3W.js">
+    <link rel="modulepreload" crossorigin href="/assets/vendor-motion-CK5zddn4.js">
     <link rel="stylesheet" crossorigin href="/assets/index-BngDXd-M.css">
   <script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
   <body>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
static/dist/sw.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor