Netlify deployment issue
Hey,
I've been deploying this project just fine 2 weeks ago but now it suddenly doesn't work.
I did re-organize my component folder but I am not sure if this is what caused it, checked the imports 10 times and everything seems fine (it works locally).
Error:
I looked through my Github history to double check, but I haven't changed my package.json or netlify.toml at all, nor any settings on Netlify.
This project is React with Vite & TypeScript.
My netlify.toml:
16 Replies
Build command in package.json:
Already tried to clear cache and redeploy multiple times.
Build settings in Netlify:
Any ideas?
The error tells you, you can also build locally it will give you same error
Your missing imports in Content block component.
So it very much had to do with you moving files 😅
Try
npm run build
locally and see though. If not it's still going to have something to do with the new import paths ( out side where they need to be?)I tried that, this works fine locally
The imports that are missed are there, removed and added them again several times
mmm and the base and publish directories are right?
that shouldn't matter though idk but the fact that it worked before and you only made changes with location of the components and that is your error its gotta be right >.>;;
what are you building in/with vite? just a static page?
Yeah a fairly simple static page, just a portfolio
when you build does it create a dist folder on your local?
Yes
can you share your component file struct and the import statement that is failing
3:23:41 PM: src/components/content/contentblock/ContentBlock.tsx(11,32): error TS2307: Cannot find module '../pages/projects/ProjectPageWrapper' or its corresponding type declarations. 3:23:41 PM: src/components/content/pages/Projects/ProjectPageWrapper.tsx(3,31): error TS2307: Cannot find module './projectnavigation/ProjectNavigation' or its corresponding type declarations.
In contentblock:
I'm either stupid or it should be correct 😉
I see Projects/ProjectPageWrapper above
src/components/content/pages/Projects/ProjectPageWrapper
double check your capitalization folders imo should always be lower case
paths/*
I see in the folders they are but check the import
Could it be something with the Types then?
Like you changed the path to the components but the types are still pulling the capital folder names? 🤷♂️
You mean this right? I am not sure where they're getting this from..
Well jesus christ
So it seems on github the folder IS 'Projects'
eh
Well it's fixed, it seems folder name changes (from capital to non capital letters) don't always push properly to Github.. Holy this was frustrating to fix
oh snap that is interesting!
I made new folders with a temporary name, pushed that, then made the proper folders
What was the fix? more than just re commiting?
ah gotcha yea what a pain
always use lower case for folder/paths 😄 so this is good to know
glad you got it working!! 💪
Yeah it somehow slipped in there while making files
Thanks as always 😉