-
Notifications
You must be signed in to change notification settings - Fork 30
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 to Next.js 14 and latest i18next #6234
Conversation
Upgrading to superagent v9 should fix that build error. See also zooniverse/Panoptes-Front-End#7143 |
Out of curiosity, why is this a build problem from app-root, but not for the other Next.js apps in the monorepo? All use superagent in PJC and the new lib-panoptes-js client. Because app-root is an App Router? |
I’ve been wondering the same thing. The error’s coming from the publications page, when it requests the project avatars in Node, but that works fine with the pages router. The error itself is caused by the webpack loader in Next.js. It’s trying to use the CJS loader with an ESM module. |
Oh, and the package with the broken export, |
If I completely delete the But then if I remove The errors are super confusing in general 🤷♀️ |
alias: { | ||
...config.resolve.alias, | ||
hexoid: 'hexoid/dist/index.js' | ||
}, |
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.
This punts the issue of upgrading Superagent, but does fix the build errors 🤔
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.
I'm really curious as to why the pages router doesn't have a problem with this. We run some stuff on 14.2, and the upgrade from 13.5 was straightforward, but we're using the pages router.
I think there might be a superagent request to get the auth'ed user on every route, but I'm not sure. I tried forcing superagent to v10, in |
@@ -64,7 +64,7 @@ | |||
"fields": { | |||
"title": "headshot", | |||
"file": { | |||
"url": "https://placekitten.com/300/300", |
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.
placekitten works inconsistently, so I replaced with our simple-avatar image.
@@ -36,11 +36,6 @@ describe('Component > Publications Page', function () { | |||
) | |||
}) | |||
|
|||
it('should have sidebar nav label', function () { |
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.
I'm not totally sure why these tests fail, but this app is going to be removed in a few weeks, so okay to delete for now.
@@ -8,7 +8,6 @@ const APP_ENV = process.env.APP_ENV || 'development' | |||
|
|||
const hostnames = { | |||
development: 'local.zooniverse.org', | |||
branch: 'fe-project-branch.preview.zooniverse.org', |
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.
This is specifically used for app-project, not app-root.
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.
PR Review
packages: app-root, app-project, app-content-pages
This PR is a major bump to our Next.JS dependency. Code changes are very simple, but since this is a major dependency for FEM, my main concern is making sure that Next.JS 14 doesn't break anything fundamental in our apps.
Testing
Tested on localhost with macOS + Chrome. For each package, I ran yarn build ; yarn start
instead of yarn dev
.
- app-root:
- I can load the home page, sign in/sign out, and view the signed-in/signed-out pages respectively.
- Minor quirk: signed-out page seems a bit slow, but that may be my computer having performance issues running videos.
- I can view my stats page.
- I can load the home page, sign in/sign out, and view the signed-in/signed-out pages respectively.
- app-project:
- I can load a test project, and sign in/sign out
- I can make and submit classifications on a simple workflow.
- app-content-pages:
- I can view the Team page, and the Publications page
Super Minor Dev Notes
- Thumbs up on replacing the placekitten placeholder images with our own hosted files. Side note, we probably should replace any unnecessary third-party assets/placeholders like this if they appear anywhere else in our codebase, to improve testing reliability. 🐱
Status
As far as I can tell, everything is looking good with this upgrade. I'm not seeing any obvious build issues, or obvious problems with the code changes. And most importantly, a standard manual test of all three packages indicate that each app functions as intended.
LGTM! 👍
Package
app-root
app-content-pages
app-project
Describe your changes
How to Review
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats
Maintenance