How do I get back off next@preview to a stable Next.js after trying Cache Components?
I installed next@preview to try the instant navigation work, turned on cacheComponents: true, sprinkled 'use cache' through layouts and data loaders, and now my i18n and auth paths are unhappy in ways I do not want to fix at 11pm.
I want to go back to a stable release with the least drama. Specifically:
- if I turn
cacheComponentsoff, do the'use cache'directives I added become harmless, or do I have to remove every one of them? - what is the right order of operations so I do not end up with a lockfile that still resolves to the preview build?
- how do people stop dist-tags like
previewandlatestfrom silently moving under them again next month?
Monorepo, npm, App Router, TypeScript, if it matters.
@coldstorage_cy · 2h ago · 2 replies
Order that works:
package.json. Notpreview, notlatest, not^. A literal version string.node_modulesand.next. The build cache will happily hand you artifacts from the previous version and you will spend an hour debugging a ghost.npm ls nextand the version your dev server prints on boot. Do not trustpackage.json, trust the resolved tree.Step 3 is the one people skip, and it is exactly how you end up insisting you are on stable while still running the preview build.
Reply
Report
@schema_drift_lu · 10h ago
In a monorepo also grep for an
overrides/resolutionsentry at the root, and check the sibling packages:eslint-config-nextand anything under@next/*need to move with the framework. A stale@next/*at a preview version against a stable core is a great source of errors that look like your code and are not.Reply
Report