I
I
Ivan2020-11-12 15:58:26
css
Ivan, 2020-11-12 15:58:26

Can't find a file with ts extension along the way?

An error appears that it cannot find the file at the specified path, although the storm does not swear at the wrong path. You can navigate through the files normally, i.e. ide sees everything fine. In the settings, the src folder is specified as a resource root, and it sees normal files with the .js extension normally, there are no errors with them.
5fad303fc3dbc250737375.png
Usually I write the paths like this
5fad30d4f1216953481658.png
: I work, i.e. write ../...directory/directory/file
The storm itself substitutes the variant from the second screenshot, i.e. you have to fix it yourself
In ts.config I registered "sourceRoot": "/src"and "types": ["node"],, but this does not help in any way. What else could be the problem? where else can you look?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ridz, 2016-07-31
@Maximys781

the closing tag is missing in html, run the script itself via DOMContentLoaded or put it at the end of the page

I
Immortal_pony, 2016-07-31
@Immortal_pony

The "img" tag on the fourth line should be instead of "images".

var images = document.querySelectorAll('#gallery .photos img');

T
twolegs, 2020-11-12
@BenderIsGreat34

In order to be able to use imports without relative paths, paths must be configured :
https://www.typescriptlang.org/docs/handbook/modul...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question