Skyscanner / backpack

Backpack Design System for the Web
https://skyscanner.design
Apache License 2.0
497 stars 186 forks source link

Error in Vercel Deployment `Module Not Found Error: Can't resolve 'react-transition-group/CSSTransition'` #3578

Open Namnika opened 3 months ago

Namnika commented 3 months ago

Hi, I just faced this vercel deployment issue on my Windows.

I have successfully created my build directory and it is working fine in my local development, but in vercel deployment, it is giving an error. I've attached a screenshot of that error.

Screenshot 2024-08-07 182239

I tried too many times to rebuild the build directory and redeploy it but still getting errors!

How to solve this issue?

Thank you.

olliecurtis commented 2 months ago

Hello @Namnika

Thanks for getting in touch and sharing details about this issue that you are facing. Vercel deployments are not something we are familiar with and use to deploy our application so our support here is limited/non existant so a solution here might not be best supported.

As you have this working locally on your machine and there is an issue at deployment with Vercel, I would say the issue is more with the Vercel side rather than backpack. So could be more better placed there

One thing that comes to mind is when you are setting up is are you installing react-transition-group directly in your project as Backpack does have a list of peer dependencies that are required to function, that you will need to install yourself in your consuming project.

This list can be found here: https://github.com/Skyscanner/backpack/blob/main/packages/package.json#L50-L56

So I would take a look to make sure you are installing these in your project first to ensure they are there for on your CI

Thanks Ollie

Namnika commented 2 months ago

Hi @olliecurtis, Thank you for your reply! I saw that error with vercel went something wrong. That error is still typically only with vercel but not with Netlify!

As I deployed my project to Netlify, it worked fine there. But don't know why it doesn't work in vercel :( No, I didn't install react-transition-group because I know there are peer dependencies inside there. Anyway, thank you for your suggestion. But please let me know if there is any solution to vercel issues...

Thank you.