Skip to content
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

Merged
merged 15 commits into from
Aug 12, 2021

Conversation

robin-macpherson
Copy link
Contributor

@robin-macpherson robin-macpherson commented Aug 10, 2021

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 & types
  • webhook.ts issue

Update:

  • After a bunch of time digging through Nexus package internals, we found that a minor version bump included a breaking change that was stopping our Generated Artifacts from being... well, generated! 🙌🏼 So now, all is right in the Journaly world and the Night's Watch crew can finally get some rest 🌙

@vercel
Copy link

vercel bot commented Aug 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/journaly/journaly/4m2a1Jrp3hFdyfpoPW2CQceJoR9u
✅ Preview: https://journaly-git-fix-build-issues-journaly.vercel.app

@robin-macpherson robin-macpherson added the DO NOT MERGE Don't merge this! label Aug 10, 2021
@robin-macpherson robin-macpherson changed the title A wee bit of detective work... Upgrade Next, React, & Fix Webpack Build Failures Aug 10, 2021
@robin-macpherson robin-macpherson changed the title Upgrade Next, React, & Fix Webpack Build Failures Upgrade Node, Next, React, & Fix Webpack Build Failures Aug 11, 2021
@robin-macpherson robin-macpherson self-assigned this Aug 11, 2021
@robin-macpherson robin-macpherson added this to In progress in Master Board via automation Aug 11, 2021

// getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually
Head.rewind()
Copy link
Contributor Author

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
Copy link
Contributor Author

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')
Copy link
Contributor Author

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.

@robin-macpherson robin-macpherson changed the title Upgrade Node, Next, React, & Fix Webpack Build Failures Upgrade Node, Next, React, TypeScript, & Fix Webpack Build Failures Aug 12, 2021
@robin-macpherson robin-macpherson removed the DO NOT MERGE Don't merge this! label Aug 12, 2021
@robin-macpherson robin-macpherson merged commit 2f97e5d into master Aug 12, 2021
Master Board automation moved this from In progress to Done Aug 12, 2021
@robin-macpherson robin-macpherson deleted the fix-build-issues branch August 12, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Master Board
  
Done
Development

Successfully merging this pull request may close these issues.

Upgrade React version to 17.x line
1 participant