Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Netlify or Vercel build error on react18 + vite (v4) + Typescript with react-router-6

While added react-router in ./src/App.tsx there was no problem on netlify or vercel build-time. But, error occurs when I imported them from a custom folder like…

netlify-build-error

But in a local machine, it is ok while run: yarn build

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

local-ss

src
│___App.tsx
|___Router.tsx
│
└───pages
│   |___HomePage.tsx
|   |___Notfound.tsx
|   |___index.ts

I’m exporting all page components from ./src/pages/index.ts.

Node Version: 18.x

Vite: 4.x

Plugin: @vitejs/plugin-react

Typescript: 4.9.x

repository: (PR) https://github.com/0xMahabub/react-vite-ts-swc-zustand/pull/2

I have tried to figure this out but couldn’t get it myself
I wish to find the actual problem and its solution and get rid of this issue.
Then I can go ahead.

>Solution :

It looks like, you forgot to add files in pages directory to staged files when you were commiting them… because they are not in you repo
just write git add . (if you have .gitignore file!) in you root folder and then commit>push

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading