Update to Next.js 14 #625
Replies: 1 comment 1 reply
-
Next.js 14 (and upcoming 15) have two different development paths, the Pages and the App Router This project was initially developed wit the Pages router which explains the use of React Helment. Next.js eventually maintained a Head component which addressed a lot of the same needs, but I felt the React Helmet API provided more capabilities which is why it remained here. In the App Router however, you're right in that there is a new API, the metdata configuration option, which only pertains to the App Router, which this project isn't yet migrated to The project isn't currently in TS but yeah that sounds like a good win to start fixing TS issues. I wouldn't be surprised if there are other issues as well I had started a new PR that migrates this project to App Router but it's not complete. Haven't had time to work through it, but it got decently far with it. hoping to be able to loop back to it soon: #477 this PR would address the watchOptions issue as its no longer part of the project, where instead of needing to hook into the compilation process to automatically trigger builds of static files, the App Router's Route Handler APIs allow an easy way to create static-like files such as an RSS feed and JSON dump of posts which is what the watchOptions feature was providing i likely won't spend any time working on upgrading this project to a new version using the Pages router and would only spend time pushing forward the App Router PR linked above. likely willing to take a PR to fix some immediate issues though as long as they're not large reworks and small fixes |
Beta Was this translation helpful? Give feedback.
-
When upgrading to v14 I see the following things to do:
react-helmet
is probably not necessary anymore due to the new metadata configuration optionsparseEnvValue
function accordingly) are all strings:TypeError: config.watchOptions.ignored.push is not a function
, which occurs fromv13.4.9-canary.2
on due to some optimizationsThe reason is, it was an array before, now it is a regex pattern, so the push won’t work anymore in the plugin scripts. I don't know the reason behind excluding those files, but I dont think it would be elegant to overwrite the regex with something own or a regex that excludes the plugin files. For now I just removed the part:
fallback: 'blocking'
in all slugs and pages in the return withfallback: false
, (as boolean, not string) since blocking and output export are incompatible. "False" means only paths during build time are valid, all others are 404s instead of ("true") creating fallback sites dynamicaly, which is what we want in our static build.Beta Was this translation helpful? Give feedback.
All reactions