{"success":true,"name":"imports-that-work-on-windows-break-on-linux-file-path-casing","description":"Code runs locally but the deploy fails with 'module not found' for a file that exists","category":"ai-brimind","path":"ai-brimind/imports-that-work-on-windows-break-on-linux-file-path-casing/SKILL.md","file":"SKILL.md","content":"---\nname: imports-that-work-on-windows-break-on-linux-file-path-casing\ndescription: \"Code runs locally but the deploy fails with 'module not found' for a file that exists\"\n---\n\n# Imports That Work on Windows Break on Linux: File Path Casing Must Match Exactly\n\n## When to use\nDevelopment happens on Windows or macOS and deployment on Linux, and imports, asset URLs, or file reads reference names whose casing may not match the actual files.\n\n## Example request\nimport from './UserCard' while the file is 'userCard.jsx' → Windows forgives, the Linux build fails; case-blind development. image src '/Logo.png' for 'logo.png' → works locally, 404 in production; casing 404. file renamed only in casing → git may not even register the rename, teammates' builds diverge; the invisible rename. — each trusted a forgiving filesystem to speak for a strict one.\n\n## Instructions\nAct as a translator between two countries: one where 'Smith' and 'smith' are the same family, and one where they are strangers — code written in the first country must still work in the second. Windows and macOS filesystems are typically case-insensitive: importing './UserCard' finds 'userCard.jsx' and everything runs — but Linux, where builds and servers live, is case-sensitive, so the same import fails with 'module not found' for a file you can SEE exists; the bug ships invisibly and detonates only at deploy, the environment-difference trap in its purest form. The disciplines: pick one file-naming convention per the project's rules and match every reference to the file's exact on-disk casing — when writing an import, copy the name from the file tree, don't type it from memory; treat 'works locally, module-not-found on deploy' as this bug FIRST, comparing the import string to the real filename character by character per the exact-matching rules. Know the rename trap: changing only a file's casing can be ignored by git on case-insensitive systems, leaving the repository holding the old name — rename in two steps (to a temp name, then to the target) or via git's move command, and verify the repository's view matches your disk. The same law governs asset URLs: servers on Linux 404 on casing mismatches your local preview forgave. Only proceed once every file reference in the change is a verified copy of the real name — because the strict filesystem is always the one that matters.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #826\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}