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

belindas-closet-nextjs_10_511_bug-fix-unit-test-errors-signup-page #520

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

Asfand00
Copy link
Contributor

@Asfand00 Asfand00 commented Jul 28, 2024

Resolves #511

Reference image:
image

This PR is for fixing the console errors that appear for the signup page after running npm test or by another command. Some investigation has been done to try and find the root cause for the errors and from my findings and with the help of @IsaacJrTypes we discovered it was a dependency issue with react and next. it seems to be a common issue with react and next so to resolve this we downgrade react and react-dom to version 18.2 and I had updated next and next-auth to the latest version. You can find more details of this on the issue page #511.

To clarify on why I upgraded next and next-auth to latest:
The reason is because on my end simply downgrading react to 18.2 didn't solve the console errors completely and I was still getting errors for the sign-up page so I had an idea to try upgrading next to 14.2.4 and had next-auth upgraded to its latest version at 4.24.7 because the previous version was incompatible with next 14.2.4.

previous versions:
next - 13.5.6
next-auth - 4.22.1
react - 18.3.1

updated versions:
next - 14.2.4
next-auth - 4.24.7
react - 18.2.0

Here are the patch notes for next 14.2 and the specific 14.2.4 release notes on GitHub, links as reference:
https://nextjs.org/blog/next-14-2
https://github.com/vercel/next.js/releases?q=14.2.4&expanded=true

This fix will also correct most of the other console errors that appear

To test: checkout my branch and run npm test and you should not see console errors appear for the sign up page

After the dependency fix, I still had console errors popping up for creator page and contact page (both of which I worked on in the past) so I was trying to fix those errors if possible, I only managed to correct the errors for the contact page but the creator page will still display this console error when testing:
console-error-creator2

I had trouble trying to fix this error (out of my depth for that one) needs more time investigating on my end, if anyone has ideas, I'm open to it otherwise it's not a big deal at the moment.

We can probably create a separate issue for this one, @keiffer213 if you want to add it to the sprint board. The main issue for the sign-up page is still solved regardless.

for the separate issue regarding the creator page test errors we will use this PR #520 and issue #511 as resources to help the next developer.

@Asfand00 Asfand00 added dependencies Pull requests that update a dependency file Sprint 10 labels Jul 28, 2024
@Asfand00 Asfand00 self-assigned this Jul 28, 2024
@Asfand00 Asfand00 linked an issue Jul 28, 2024 that may be closed by this pull request
@Asfand00 Asfand00 requested review from JesseCaddell and removed request for a team July 28, 2024 06:05
Copy link

socket-security bot commented Jul 28, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] Transitive: environment, filesystem, shell, unsafe +60 12.7 MB nicolo-ribaudo
npm/@emotion/[email protected] Transitive: environment, filesystem, unsafe +69 11.2 MB emotion-release-bot
npm/@emotion/[email protected] Transitive: environment, filesystem, unsafe +65 10.3 MB emotion-release-bot
npm/@mui/[email protected] None +2 19 MB aarongarciah, atomiks, brijeshb42, ...7 more
npm/@mui/[email protected] Transitive: environment +26 19.8 MB aarongarciah, atomiks, brijeshb42, ...7 more
npm/@testing-library/[email protected] environment Transitive: eval +23 7.96 MB testing-library-bot
npm/@types/[email protected] None +2 1.69 MB types
npm/[email protected] environment, network Transitive: filesystem +24 9.92 MB vkarpov15
npm/[email protected] environment, network +14 3.97 MB thvu
npm/[email protected] environment, filesystem, network, shell, unsafe +23 1.2 GB vercel-release-bot
npm/[email protected] environment +3 4.63 MB react-bot
npm/[email protected] environment Transitive: network +2 4.37 MB mjackson
npm/[email protected] environment, filesystem, unsafe Transitive: eval, network, shell +149 15.9 MB kul

🚮 Removed packages: npm/@babel/[email protected], npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@mui/[email protected], npm/@mui/[email protected], npm/@testing-library/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

@Asfand00 Asfand00 marked this pull request as ready for review July 31, 2024 07:04
Copy link
Contributor

@intisarosman1 intisarosman1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests ran successfully without issues, great work!
Screenshot 2024-07-31 063622

Copy link
Contributor

@ken-ni ken-ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, it looks like there are no more errors for for the sign-up page when running npm test!
image

@Asfand00 Asfand00 merged commit 808d5e2 into main Aug 2, 2024
6 checks passed
@keiffer213 keiffer213 deleted the bug-511-fix-unit-testing-sign-up-page-01 branch October 13, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Sprint 10
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug: Fix testing error for sign up unit test
3 participants