Skip to content

Fix export serverless functions on Node 14 #3417

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

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Fix export serverless functions on Node 14 #3417

merged 1 commit into from
Oct 31, 2022

Conversation

chrisgzf
Copy link
Member

@chrisgzf chrisgzf commented Oct 24, 2022

Closes #3415

Context

Vercel deprecated Node 12. We then migrated to Node 16 in #3414 if not the site doesn't build on Vercel. In the process, there was a regression with the export service, because chrome-aws-lambda and puppeteer, in their older versions, do not work with Node v14/v16.

This PR bumps their versions slightly to v6.0.0, which allows it to work with Node 14.

Note that this isn't the latest chrome-aws-lambda nor the latest puppeteer, because the APIs for puppeteer have changed a lot since and it takes more effort for us to migrate it to the latest API.

These changes have also not been tested with Node 16 yet. I just lowered the build target to Node 14 first so that we minimise any environment API changes while fixing this issue.

This PR has been tested to fix the issue, and the fix has now been manually promoted to production on Vercel.

To test, click on this link to download my timetable.

@chrisgzf chrisgzf requested a review from a team October 24, 2022 16:49
@vercel
Copy link

vercel bot commented Oct 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nusmods-export ✅ Ready (Inspect) Visit Preview Oct 24, 2022 at 4:49PM (UTC)
nusmods-website ✅ Ready (Inspect) Visit Preview Oct 24, 2022 at 4:49PM (UTC)

@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

Base: 53.04% // Head: 53.02% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (d09ca38) compared to base (a76d477).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3417      +/-   ##
==========================================
- Coverage   53.04%   53.02%   -0.02%     
==========================================
  Files         270      270              
  Lines        5756     5756              
  Branches     1333     1333              
==========================================
- Hits         3053     3052       -1     
- Misses       2703     2704       +1     
Impacted Files Coverage Δ
website/src/views/timetable/Timetable.tsx 93.54% <0.00%> (-3.23%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chrisgzf chrisgzf merged commit d996b7e into master Oct 31, 2022
@chrisgzf chrisgzf deleted the fix-export branch October 31, 2022 15:21
zwliew added a commit that referenced this pull request Aug 5, 2023
Vercel disables Node 14 support on 15 Aug 2023, and Node 16 support on 6
Feb 2024. Let's future-proof and not worry about this for a while by
supporting Node 18.

References for migration to @sparticuz/chromium:
* alixaxel/chrome-aws-lambda#275
* https://github.com/Sparticuz/chrome-aws-lambda
* https://github.com/Sparticuz/chromium#migration-from-chrome-aws-lambda

References for upgrading puppeteer:
* https://pptr.dev/chromium-support

References for prior Node upgrades:
* #3417
* #3414
zwliew added a commit that referenced this pull request Aug 5, 2023
Vercel disables Node 14 support on 15 Aug 2023, and Node 16 support on 6
Feb 2024. Let's future-proof and not worry about this for a while by
supporting Node 18.

References for migration to @sparticuz/chromium:
* alixaxel/chrome-aws-lambda#275
* https://github.com/Sparticuz/chrome-aws-lambda
* https://github.com/Sparticuz/chromium#migration-from-chrome-aws-lambda

References for upgrading puppeteer:
* https://pptr.dev/chromium-support

References for prior Node upgrades:
* #3417
* #3414
zwliew added a commit that referenced this pull request Aug 5, 2023
Vercel disables Node 14 support on 15 Aug 2023, and Node 16 support on 6
Feb 2024. Let's future-proof and not worry about this for a while by
supporting Node 18.

References for migration to @sparticuz/chromium:
* alixaxel/chrome-aws-lambda#275
* https://github.com/Sparticuz/chrome-aws-lambda
* https://github.com/Sparticuz/chromium#migration-from-chrome-aws-lambda

References for upgrading puppeteer:
* https://pptr.dev/chromium-support

References for prior Node upgrades:
* #3417
* #3414
zwliew added a commit that referenced this pull request Aug 5, 2023
Vercel disables Node 14 support on 15 Aug 2023, and Node 16 support on 6
Feb 2024. Let's future-proof and not worry about this for a while by
supporting Node 18.

References for migration to @sparticuz/chromium:
* alixaxel/chrome-aws-lambda#275
* https://github.com/Sparticuz/chrome-aws-lambda
* https://github.com/Sparticuz/chromium#migration-from-chrome-aws-lambda

References for upgrading puppeteer:
* https://pptr.dev/chromium-support

References for prior Node upgrades:
* #3417
* #3414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download links for timetable is not working
1 participant