lukef7fywmrp / twitter-clone

twitter-clone-eosin.vercel.app
203 stars 60 forks source link

Things to consider when building with newer Next versions (I used "13.1.1") #2

Open fellipxd opened 1 year ago

fellipxd commented 1 year ago

I came across your tutorial on youtube and am attempting to follow along. I noticed some areas where little changes might need to be made to ensure it worked with the version I'm using.

  1. I couldn't get emojimart to work. I looked online and found that I hade to use @emoji-mart/react also for some reason I couldnt use inline styling on the Picker so I had to put it in a div and adjust it's position that way (I did'nt look to deep into why it behaved like this and just used the quickest fix)
  2. In the getServerSideProps function on the index I had to change the web address from https://jsonkeeper.com to https://www.jsonkeeper.com cause it kept throwing this error Error [ERR_TLS_CERT_ALTNAME_INVALID]

(if I notice anymore I'll add em as I go)

INCASE YOU SEE THIS I REALLY ENJOY YOUR BUILDS.....

PavanSugreev04 commented 3 months ago
  1. Handling Dependency Conflicts When updating to React 18, you might find that some of your other dependencies aren’t compatible with it. Here’s what to do:

1.1 Check Compatibility

Look at the documentation or release notes for each dependency to see if it supports React 18. 1.2 Update or Replace Dependencies

Update any dependencies that have newer versions compatible with React 18. You can do this by running:

bash Copy code npm update If some dependencies still don’t work, you might need to replace them with alternatives or find newer versions that are compatible with React 18.

  1. Handling Installation Errors If you face issues while installing packages, try these solutions:

2.1 Use --legacy-peer-deps

This option lets npm ignore some of the strict rules about package versions, which can help resolve conflicts. Run:

bash Copy code npm install --legacy-peer-deps 2.2 Use --force

This option forces npm to install packages even if there are conflicts. Run:

bash Copy code npm install --force

  1. Additional Tips 3.1 Regularly Update Dependencies

Keep your packages updated to avoid conflicts and get the latest features and fixes. 3.2 Review Documentation

Make sure all your main dependencies are compatible with each other and the versions you are using. 3.3 Test Your Application

After making updates, thoroughly test your application to ensure that everything works correctly and no new issues have been introduced.