question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No definition found when ts code is in a subfolder

See original GitHub issue

Hi there! So I tried to installing atom and atom-typescript to see how it compares with Visual Studio / WebStorm for nodejs web projects. What I immediately noticed is that I’m getting Atom Ts: No definition found.

“What the heck does this mean?” though I. Well after searching the issues here, it became apparent that this is because of missing tsconfig.json. (Could the error message be improved? A user has no fighting chance dealing with this cryptic error message).

But the thing is, my tsconfig.json was not missing. It was there all right. It was working perfectly in WebStorm. What I quickly realized is that atom-typescript expects tsconfig.json at the project root.

I prefer to have all typescript files in a subfolder (as opposed to js, etc). Firstly I feel it’s cleaner. Secondly, from time to time ts files appear inside node_modules, and ts compiler (at least in webstorm) dutifully walks the whole tree and compile them. And then complains. I did not want that to happen so I moved all my TS in a subfolder, put there tsconfig.json and it worked perfectly, but not in atom.

How do I configure atom-typescript so that it looks for tsconfig.json in a different place and starts transpiling from that folder? Is it possible to improve the error message?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jonsamwellcommented, Sep 4, 2015

Yeah, that looks like the issue

0reactions
javascriptoniancommented, Dec 12, 2015

I was getting the same problem, but all I did was set “buildOnSave” from false to true, and restart the atom IDE. It was working fine with me without reinstalling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode not recognizing types in sub directories
I'm getting the following error: Cannot find name 'describe'. Do you need to install type definitions for a test runner?
Read more >
Include *.d.ts files with ambient definitions from a subfolder
Hello, after reading the documentation for hours, I could not find a possibility to include *.d.ts files from a subfolder.
Read more >
Should the .sfdx or any of its sub-folder and/or files be added ...
In the case of the project I am currently looking at, there's a defaultdevhubusername and a defaultusername , but I am not sure...
Read more >
Finding files in project subdirectories
This is an issue when trying to re-use the same code. This issue is solved by using rprojroot: the function find_root_file() finds a...
Read more >
CCS 5.5 include folder with all its subfolder as "search path"
When I do, though, the build is not successful because the linker doesn't find the files contained in the subfolders.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found