Next.js

Next.js: Turbopack JavaScript Compatibility and Debugging Improvements

Major improvements to Turbopack's JavaScript compatibility with fixes for NaN and zero equality handling, plus enhanced debugging tools for trace analysis. Additional dependency updates and documentation clarifications round out the changes.

Duration: PT2M6S

https://podlog.io/listen/next-js-36fde2ae/episode/next-js-turbopack-javascript-compatibility-and-debugging-improvements-dd2a3499

Transcript

Good morning. This is your Next.js developer briefing for June 1st, 2026.

The big story today is a significant step forward in Turbopack's JavaScript compatibility. The team has fixed fundamental issues with how the bundler handles special numeric values - specifically NaN equality and positive versus negative zero comparisons.

Two related pull requests, 94172 and 94177, tackled this by replacing the custom TotalOrderF64 implementation with standard f64 and serde_json::Number types. This brings Turbopack's analyzer in line with how JavaScript actually handles these edge cases. As one contributor noted, JavaScript treats NaN as equal to NaN in certain contexts, and distinguishes between positive and negative zero - behavior that wasn't properly replicated before. The fix enabled previously failing execution tests to pass, suggesting this could resolve some hard-to-debug bundling inconsistencies you may have encountered.

The debugging experience also got an upgrade. Pull request 93961 fixed a usability issue with the trace server tooling. Previously, when you started a trace server on a non-default port, the suggested command-line queries would still point to the default port, causing confusing connection errors. Now the startup hints include the correct port number, making the debugging workflow more reliable.

On the infrastructure side, there were updates to PostCSS config resolution through a backport to the next-16-2 branch, improvements to the Node File Trace system for better bundle analysis, and a major version bump of the ctor crate dependency from 0.10 to 1.0.6 to address rust-analyzer issues.

Looking ahead, these JavaScript compatibility fixes should reduce subtle bundling differences between development and production builds. The improved debugging tools will make investigating performance issues more straightforward when they do occur.

That's your Next.js update. We'll be back tomorrow with more developer news.