- 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?
This post has been translated by AI.
Post summarized by durumis AI
- During the Next.js Turbopack debugging process, I worked on identifying the file-specific logic application method due to a test case error.
- As a result of the work, the content of a specific file was identified as the root cause of the issue, and related test cases were deactivated to reduce debugging time.
- I documented the experience of encountering unexpected test errors even with minor changes, leading to a significant amount of debugging time.
It was a very minor change, logically perfect, yet it broke the test case. The problem was that the cause was completely unclear...
So, even though it was my birthday weekend, I had to do some grunt work. I applied the old logic to some files based on their filenames to figure out which files were incompatible with the new logic.
I did this grunt work one by one like this,
and finally figured out the problematic test case. But the contents of that file were
'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'); }
all. Since it seemed like debugging would take a long time, I deactivated the related test case.
TURBOPACK=1 pnpm test-dev test/e2e/prerender.test.ts