· JavaScript
next.js 16.6.0-canary.1 released with 405 for forbidden Route Handler methods
The introduction of a new requirement for parallel routes, specifically that named slots now necessitate a default.js file in version 16, is one of the notable adjustments in the latest release of…
The introduction of a new requirement for parallel routes, specifically that named slots now necessitate a `default.js` file in version 16, is one of the notable adjustments in the latest release of next.js 16.6.0-canary.1.
Among the various updates, a significant core change addresses route handlers: methods that are forbidden for fetching must now return a 405 status code, as detailed in issue #102709.
Beyond these foundational shifts, several miscellaneous enhancements have been rolled out. Turbopack has received improvements allowing it to read the `main` and `alias` fields from `package.json` using typed projections, a change tracked under #100980. Furthermore, Turbopack's capabilities have been expanded to monitor named bindings and evaluation across different fragments, as noted in #100897.
Other technical refinements include the addition of source frames for errors generated by the Go route compiler (#102720), and an update ensuring that the Turbopack loader output becomes invalid when directory entries undergo modification (#101972). Regarding module processing, Turbopack is now equipped to handle JavaScript and TypeScript modules, such as `.js` and `.ts` files, selected by its rules (#102024). Finally, a fix has been implemented to improve Turbopack's recovery process after a missing Sass partial is created (#101971).
The development team extends sincere gratitude to @icyJoseph, @lukesandberg, @jimmyhmiller, and @timneutkens for their valuable contributions to this release.
Why it matters
Developers using Route Handlers should be aware of the new requirement to return 405 for forbidden methods. These changes affect how serverless functions behave within the framework.