fix: Windows slash hell, controllers: [path.join(__dirname,"/api/controllers/*.ts") doesn't work on Windows #987
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
Description
I used routing-controllers about 2 years ago everything was fine. But today I created a new project and got strange issue.
doesn't find controllers on Windows
Expected behavior
controllers are found
Actual behavior
path.join converted to \api\controllers (windows slash) and glob failing
still no luck, because in /util/importClassesFromDirectories.js
path.normalize again converts / to \ and glob failing again
after removing path.normalize (hardcoded in node_modules for science)
controllers are finally found
Is it a bug ? Or i need some better workarounds ?
Environment
Windows 11
Node v16.13.1
"glob":"8.0.3"
"typedi": "^0.10.0",
"routing-controllers":"0.10.0"
"typescript": "^4.9.4"
"ts-node-dev": "^2.0.0" (issue reproduced in compiled js too though)
The text was updated successfully, but these errors were encountered: