- fix(turbopack): Do not create invalid `EcmascriptModulePartAsset` by kdy1 · Pull Request #70016 · vercel/next.js
- What? EcmascriptModulePartAsset is invalid if the splitting is failed. We now carefully create it, only when the original module is splitable. Why? This is part of the tree-shaking PR. How?
AI 翻译的文章。
durumis AI 总结的文章
- 在 Next.js Turbopack 除錯過程中,由於測試案例發生錯誤,因此進行了檢查檔案邏輯應用方式的作業。
- 作業結果,確認特定檔案的內容為問題根源,並且為了縮短除錯時間,停用了相關的測試案例。
- 記錄了即使進行微小變更,也可能發生預期外的測試錯誤,導致除錯耗費相當時間的經驗。
這顯然是個非常小的變動,小到可以說是邏輯上完全正確的,但測試案例卻失敗了。問題是,根本找不到原因…
所以,儘管週末是生日,但我還是做了很多苦力。我根據檔案名稱,對部分檔案套用舊邏輯,試圖找出哪些檔案與新邏輯不兼容。
我這樣一個個地做了很多苦力,
最終找到了有問題的測試案例。但那個檔案的內容是
'use strict'; if (process.env.NODE_ENV === 'production') { module.exports = require('./cjs/react-jsx-runtime.production.js'); } else { module.exports = require('./cjs/react-jsx-runtime.development.js'); }
而已。由於感覺除錯會花很長時間,所以我停用了相關的測試案例。
TURBOPACK=1 pnpm test-dev test/e2e/prerender.test.ts