-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Node, Next, React, TypeScript, & Fix Webpack Build Failures #638
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/journaly/journaly/4m2a1Jrp3hFdyfpoPW2CQceJoR9u |
|
||
// getDataFromTree does not call componentWillUnmount | ||
// head side effect therefore need to be cleared manually | ||
Head.rewind() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Head.rewind has been a no-op since Next.js 9.5, in Next.js 11 it was removed. You can safely remove your usage of Head.rewind.
https://nextjs.org/docs/upgrading
@@ -1 +1 @@ | |||
14.15.4 | |||
14.17.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest LTS
@@ -1,6 +1,12 @@ | |||
let config = { | |||
target: 'serverless', | |||
productionBrowserSourceMaps: true, | |||
webpack: (config, { isServer }) => { | |||
if (isServer) { | |||
config.externals.push('_http_common', 'bufferutil', 'utf-8-validate') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See PR description. _http_common
was a documented bug with Prisma needing to upgrade undici
to 4.0.0, however the latter two I'm less sure about the origin.
closes #530
Description
Through investigating some new build errors that appeared, I experimented with various package upgrades and eventually found that the issue appeared to be with Next.js now defaulting to using webpack 5 - which seems to have caused various issues trying to resolve server-only dependencies in the client and began giving us trouble with
@prisma
internal dependencies along with some others.Upon further investigation, the
@prisma
related stuff was addressed with a workaround discussed in this issue and looks like it will be fixed in this PR. I used the same workaround to address a couple of other internal deps outside of Prisma as well... 🧐I thought it would be worth keeping the work on finally upgrading to React 17 along with TypeScript and the new major release of Next, along with updating our pinned Node & NPM versions to latest LTS.
Also includes fixing a couple of other things that started failing:
node-fetch
dependency & typeswebhook.ts
issueUpdate: