Strapi build fails without tsconfig and with any parent directory for which Node lacks permissions to read. #19007
Labels
issue: bug
Issue reporting a bug
severity: low
If the issue only affects a very niche base of users and an easily implemented workaround can solve
source: typescript
Source is related to TypeScript (typings, tooling, ...)
status: pending reproduction
Waiting for free time to reproduce the issue, or more information
Bug report
Required System information
OS: linux-x64
Strapi Version: 4.15.4
Node/Yarn Version: yarn/1.22.21 npm/? node/v18.18.2 linux x64
Edition: Community
Database: mysql
Project: Javascript
Describe the bug
After updating Strapi from 4.12.4 to 4.15.4, when no tsconfig is present, dividab/tsconfig-paths tries to find config file by iterating to parent directories as long as one exists. Incase there are no rights to read the contents of parent directory (common among hosting providers to launch node in a directory for which the user is denied to read the contents of) uncaught error is thrown. This unreadable directory does not have to be direct parent of strapi installation directory. This makes it impossible to build strapi after update.
Steps to reproduce the behavior
Expected behavior
https://github.com/dividab/tsconfig-paths used should catch the error and incase directory can't be read, it should count as tsconfig not present.
Temporary solution for Strapi
I've reported the bug: dividab/tsconfig-paths#258 but it seems there is no adequate activity. I have currently solved the problem by setting env variable TS_NODE_PROJECT used by tsconfig-paths to Strapi installation directory.
The text was updated successfully, but these errors were encountered: