remix: Invalid route module file: /....../app/routes/.DS_Store
Any time I open my app in the file system, Apple does this stupid thing and creates a .DS_Store file. Could we just ignore .DS_Store files in the routes?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 22 (10 by maintainers)
Yes. Every file in the routes directory is considered a route. So you need to move CSS files outside the routes
I tried to remove the .DS_Store files manually from the
/routesdirectory, without success. This worked:find . -name ".DS_Store" -print -deletehttps://remix.run/docs/en/v1/tutorials/jokes#styling says
Except you cannot put it anywhere you like. You cannot put it in the
/routesdirectory. smh.rant I’m disappointed to see this “package by type” convention still happening more than 20 years after most developers decided it was a bad idea - it’s like saying all Blondes must live in the same apartment 🤦♂️
Ideally everyone that is closely connected would live in the same apartment (folder) - e.g. route, component, and css should all live together because they are closely connected. Complete strangers should live in different apartments - e.g unrelated routes, css, components, etc should be in different folders.
I’d much rather see any file named
*.__route.jsis considered a route no matter where it is in the/appfolder. /rantI’d like to ignore all “.” files once we add file name escaping. This will make editors live VIM happy when they use tmp files.
@pmlk I had to use
**/*.test.*for it to work!Maybe this is the wrong place, but since I tried to tackle my problem with
ignoredRouteFilesI figure someone else might think the same thing and come across this issue/thread.I’m testing my remix app with
jestand I’m placing my test files alongside the route files, e.g.:Unfortunately, this causes an error when I open any page:
ReferenceError: describe is not defined.Since the documentation for
ignoredRouteFilesstates the followingI figured setting
ignoredRouteFiles: [".*", "*.test.tsx"],would solve my problem. But it seems that it does not.What am I doing wrong or misunderstanding here? 😃
Actually, this is not true, but it’s not your fault you didn’t know that. I just merged a docs PR to fix this: https://github.com/remix-run/remix/pull/1671
You can use
ignoredRouteFilesin your Remix config to ignore any pattern you like (including*.css).So yes, please do colocate your stuff. This issue is closed (the
create-remixCLI generates config that ignore dotfiles by default).Thanks!
Not quite. #989 will address @Ferdzzzzzzzz’s use case though.