Closed hdeweirdt closed 2 months ago
I have the same behavior when I want to add empty events or services folder by adding .gitkeep or .gitignore
Hi @hdeweirdt
Thanks for raising the issue.
I wasn't aware that the DS_Store looks like a folder here?
'/Users/harm/Projects/cashless-pay/docs/event-catalog/events/.DS_Store/index.md'
Is that correct on your file system?
➜ events git:(main) ls -al .DS_Store
-rw-r--r--@ 1 harm staff 6148 Mar 7 09:23 .DS_Store
➜ events git:(main) cd .DS_Store
cd: not a directory: .DS_Store
The @ means it's a symbolic link, but it won't resolve to a location. I'm new to MacOS so don't fully get that .DS_Store either.
Same error in my laptop. Seems that .DS_Store files are being considered as folders.
Terminal output:
error - Error: ENOTDIR: not a directory, open '/Users/carlos/Documents/Pro/Project/CommonDocumentation/IT/domain-service-catalog/domains/.DS_Store/index.md'
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/Users/carlos/Documents/Pro/Project/CommonDocumentation/IT/domain-service-catalog/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[1]!/Users/carlos/Documents/Pro/Project/CommonDocumentation/IT/domain-service-catalog/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[2]!/Users/carlos/Documents/Pro/Project/CommonDocumentation/IT/domain-service-catalog/.eventcatalog-core/styles/globals.css': No serializer registered for Warning
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 3 items } -> webpack/lib/ModuleWarning -> Warning
Your environment
EventCatalog version used: 0.0.1
Environment name and version Firefox 100.0.2, Node.js 15.14.0
Operating system and version: MacOS 12.4 MacBook Pro M1 2020
Not a solution but a quick fix to not get stuck is to add a basic command for removing those files before building:
"build": "npm run clean && eventcatalog build",
"clean": "find . -name '.DS_Store' -type f -delete",
There is no real danger in removing them, so this should be safe and good.
On another note I did a 10-second test by just adding an fs.existsSync(dir)
to return empty if the relevant code path is not a directory but the logic is deeper than that, so we still need to spend a bit more effort getting that to work beyond that basic check.
Thanks for giving a solution @mikaelvesavuori
For anyone having this issue maybe it's worth having that clean
script @mikaelvesavuori has added.
I'm happy to add the clean script to all catalogs (using create-catalog) but I'm not sure if that would work for windows users, any ideas @mikaelvesavuori ?
Since the command will be unrecognized on Windows, and also since the .DS_Store
will never be generated on a Windows machine, it is all completely Linux/Mac oriented. I advise against putting this in EventCatalog, though the checks in the code should ignore/not return non-directory items—i.e. solving the actual problem, rather than its symptom.
Thanks for the workaround @mikaelvesavuori! The clean script works perfectly.
Thanks for the workaround @mikaelvesavuori !
Closing this issue.
EventCatalog v2 is being released, and no longer an issue.
If you still experience any of these issues, please raise a new ticket.
Thank you!
Have you read the Contributing Guidelines on issues?
Description
After opening a folder on MacOS using their Finder program, it creates .DS_Store files automatically. When starting the server and browsing to a directory (events, services or event the homepage) a "Server Error" is shown:
Steps to reproduce
Expected behavior
No crash should occur even if there is a .DS_Store file, these files should be ignored.
Actual behavior
Your environment