Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strapi build fails without tsconfig and with any parent directory for which Node lacks permissions to read. #19007

Open
stentibbing opened this issue Dec 7, 2023 · 0 comments
Assignees
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

Comments

@stentibbing
Copy link

stentibbing commented Dec 7, 2023

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

  1. Disable rights for node to read any Parent directory of Strapi installation
  2. Make sure no tsconfig is present for Strapi
  3. Build strapi

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.

@derrickmehaffy derrickmehaffy added 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 status: pending reproduction Waiting for free time to reproduce the issue, or more information source: typescript Source is related to TypeScript (typings, tooling, ...) labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: To be reviewed (Open)
Status: To review
Development

No branches or pull requests

3 participants