简体   繁体   中英

Trouble deploying react-app on Vercel. Build Errors

I'm new to deploying apps, and decided to use Vercel. I keep getting the same build error as shown below. I'm not sure what direction to go in to solve this issue. If anyone can help please let me know.

https://github.com/owenosa/cryptodash

在此处输入图像描述

I have had the same error output when trying to deploy a react app that had some compiler warnings, check your browser console on your dev environment to see if you have any errors or warnings.

After fixing all warnings it worked like a charm for me.

I was having a problem deploying to Vercel and it turns out that it was a problem with how Vercel handles case sensitivity vs the react local build.

If I have the following filename: myCoolIcon.svg And I import it like so in a component:

import coolIcon from '/images/mycoolicon.svg'

It will not throw an error my local React built but it will throw an error when deploying to Vercel and cause the build to fail.

If you change the import to import coolIcon from '/images/myCoolIcon.svg' it will then work on the Vercel build.

Change node verson to fix it. go to your error deployment -> settings, in change settings, change the verson of nodejs (from 18x to 16x or 14x) and then re-deploy. It's work for me! click to view example photo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM