SOLVED: Had to use git clone rather than file transfer
Hey everyone! Looking for some help here.
I’m working with a vite typescript setup and running into a weird issue.
On my Windows development machine, everything works perfectly when I run “npm run dev”. The app loads fine at localhost:4200 and all features work as expected.
But when I try to run the same project on my Linux server after installing dependencies, I get TypeScript import failures. The console shows errors about missing exports from my custom type definitions.
Here’s my deployment process:
Build the React app locally until it works
Set up new React project on Linux server
Transfer src directory, package.json and environment file using SCP
Run “npm install” to get dependencies
Execute “npm run dev” which starts on localhost:4200
Try to access via [server-url:4200] from browser
Get TypeScript import errors in console
Project doesn’t load properly
What’s the best approach for deploying a React project across different operating systems without issues?
Note: I can’t use “npm run build” because there are TypeScript issues that need fixing, but I have a demo coming up soon so no time for major changes!
The specific error message:
MapComponent.tsx:5 Uncaught SyntaxError: The requested module '/src/types/Events.ts' does not provide an export named 'EventType' (at MapComponent.tsx:5:12)
I’ve encountered something similar before when transferring projects between Windows and Linux environments. The issue you’re experiencing is likely related to file path case sensitivity differences between the operating systems. Windows is case-insensitive while Linux is case-sensitive, so if your import statement references ‘EventType’ but the actual export in Events.ts uses different casing, it will work on Windows but fail on Linux. Another possibility is line ending differences (CRLF vs LF) that can sometimes cause parsing issues. When you use git clone instead of SCP file transfer, git automatically handles these cross-platform compatibility issues including line endings and maintains the exact file structure. This explains why your git clone approach solved the problem. For future deployments, I’d recommend always using git for code transfers rather than manual file copying to avoid these OS-specific quirks.
This exact scenario bit me when I moved from macOS to Ubuntu for production deployment. The root cause is definitely the case sensitivity issue that FlyingLeaf mentioned, but there’s also another factor at play - hidden files and metadata that don’t transfer properly with SCP. When you manually copy files, you often miss crucial configuration files like .gitignore, .env.local variants, or even tsconfig paths that might have subtle differences. Git handles all of this seamlessly because it tracks the complete project state including file permissions and hidden configurations. I learned this the hard way after spending hours debugging what seemed like identical codebases. Now I always deploy via git operations even for quick demos - it saves massive headaches. The TypeScript module resolution also behaves differently between environments when files aren’t transferred with their complete context intact.
glad you figured it out! scp can be tricky with node projects becuase it doesnt preserve all the file metadata that git tracks. i’ve had similar issues where modules work fine locally but break after manual transfers - usually its either case sensitivity or missing dotfiles that mess things up.