2020-11-26 05:23

atom-typescript can't find tsconfig.json

My project structure is something like this: - / - foo/ - other/ - bar/ - tsconfig.json - src/ - ts/ - file.ts

This used to work fine until I updated to atom-typescript 9.0.0. After updating to 9.0.0 it can no longer find tsconfig.json. no tsconfig.json


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39893893 weixin_39893893 4月前

    Same here! This is causing me quite some pain right now.

    I have a project with client and server (node) sources in the same project but with different roots and different tsconfig.json files: - / - tsconfig.json (for server sources in /src) - src/... - client/ - tsconfig.json (for client sources in /client/src) - src/...

    This worked perfectly a little while ago, but not any more now.

    EDIT: I found out this seems to happen just with that one project. In another project (though it contains only a single tsconfig) it works properly and atom-typescript is also properly rewriting the config file.

    EDIT 2: After some more testing I found out that the reason it doesn't work doesn't seem related to having 2 tsconfig files or a new atom-typescript version. Instead (at least in my case) this seems to be related to #921, Atom shows me for all files "no tsconfig found".

    Then I tried removing / adding some directories and files until I got it working again. By doing that I found out that once I removed the node_modules directory in my root folder, atom-typescript would properly recognize both tsconfig files again.

    EDIT 3: Some more testing later: It looks like this was caused because I had a npm linked module in my node_modules which didn't exist in the global package store any more (i.e. the junktion (windows symlink) was invalid),

    点赞 评论 复制链接分享
  • weixin_39974557 weixin_39974557 4月前

    Any solution to this? I have a very similar project-structure, and atom-typescript doesn't seem to pick up the tsconfig.json. For now, I solved it with putting a symbolic link to the tsconfig.json-file into my src-folder. Here is my folder-structure. If any more information is needed, I will gladly provide them.

    • tsconfig.json
    • src/
      • app.ts
    点赞 评论 复制链接分享
  • weixin_39862484 weixin_39862484 4月前

    Wouldn't it be simpler to just be able to give the plugin a path to config file (something like configFile/configFileName in webpack loaders)? I had to create a symlink to my tsconfig.json otherwise atom couldn't find it, as it's located in a subfolder of my project's root.

    Providing such path from the package's settings in Atom would be a great way of solving this issue.

    点赞 评论 复制链接分享
  • weixin_39657300 weixin_39657300 4月前

    And if you're working on multiple projects that need this feature, would you go to the package's settings every time you switch between them? That does not seem sustainable.

    It's almost like we need a way for each project to tell the plugin where to find the tsconfig.json file. Perhaps another configuration file in an easy to find location - at the project root? But then, why not just put tsconfig.json there in the first place? 😄

    点赞 评论 复制链接分享
  • weixin_39862484 weixin_39862484 4月前

    Indeed it's a fair point. Guess there's no easy solution for this one, then 🤔 (Until Atom supports per-project configuration, at least)

    点赞 评论 复制链接分享
  • weixin_39657300 weixin_39657300 4月前

    👍 on the per-project configuration in Atom.

    点赞 评论 复制链接分享
  • weixin_39778106 weixin_39778106 4月前

    This issue has been marked as stale because it did not have any activity for the last 90 days or more. Remove the stale label or comment or this will be closed in 14 days

    点赞 评论 复制链接分享