TSC is unavailable - Unable to read file named "anything.ts": File is missing

I have been facing a frustrating issue with the TSC Typescript compiler. No matter what I try, I cannot seem to make it find any files. I have experimented with both the tsc provided by the Visual Studio Extension and the one from npm. I've attempted running it in the Node.js command line window as well as the Git Bash shell, but to no avail. The error message always states that the file is not found. I am aware that the compiler should work for .ts and .str files, yet this does not appear to be the root cause of the problem.

Let me illustrate the situation I am encountering with a brief example. While I understand these files are likely empty placeholders, my attempts with actual code files have yielded the same outcome.

C:\>touch test.ts

C:\>ls *.ts
test.ts

C:\>tsc test.ts
Error reading file "test.ts": File not found

C:\>tsc C:\test.ts
Error reading file "C:\test.ts": File not found

C:\>touch test.str

C:\>tsc test.str
Error reading file "test.str": File not found

C:\>tsc ./test.str
Error reading file "./test.str": File not found

C:\>tsc ./test.ts
Error reading file "./test.ts": File not found

C:\>touch test.js.ts

C:\>tsc test.ts
Error reading file "test.ts": File not found

C:\>tsc test.js
Error reading file "test.js": File not found

Answer №1

Unfortunately, TSC does not handle empty files well in this scenario.

Answer №2

It appears there may be a glitch in the latest compiler [0.8], as tsc should not encounter errors with empty files. Nonetheless,

Even though I anticipate these files to be empty, I have experimented with files that have code in them and the outcome remains unchanged.

This particular aspect concerns me. Has this issue been resolved?

Answer №3

Diagnosing this issue remotely can be quite challenging. The TypeScript compiler undergoes extensive processing before resolving a file.

Could you share the result of executing

tsc -debug test.ts

? Additionally, please confirm that test.ts contains content.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can someone guide me on how to access the release notes for an npm package prior to upgrading?

Is there a consistent way for npm registry to display release notes? I have noticed release notes being shown in various places: The README.md file On GitHub as a tagged release without a description On GitHub as a tagged release with a des ...

Versatile functions and unique index classifications

I need help creating a versatile function that takes a type argument "T" representing an object. It should use keyof T to determine the first argument named "property". However, I am struggling with defining the type of the second argument, called "value", ...

Out of nowhere, NPM begins installing globally to the directory /usr/lib/node_modules. How did this happen and where did it come

A few days ago, all the global installations I made were placing modules in /opt/node/lib/node_modules. However, now all new global installs are being thrown into /usr/lib/node_modules. I'm puzzled as to why this sudden change in behavior is happenin ...

What is the best way to integrate this Google Dialogflow code into a TypeScript-based React application?

The integration of your chatbot into an HTML page using Google Dialogflow includes the following code snippet: <script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script> <df-messenger inten ...

To populate an Ionic list with items, push strings into the list using the InfiniteScroll feature

Looking for help with implementing infinite scroll in a list? I am using the ion-infinite-scroll directive but struggling to push string values into my list. The list contains names of students in a classroom. Can anyone provide guidance on how to push str ...

Tips for linking the controls of storybook with manual state updates

I'm a newcomer to storybook and frontend development. Below is the code for my checkbox.tsx component: import React from 'react'; import styles from './checkbox.module.css'; // Make sure this import is correct interface CheckboxP ...

Issue encountered while executing npm command

I've successfully installed node.js, but I'm facing an issue with the npm command in the command prompt. Even after setting the environmental variables, the command is not being identified. Can anyone please assist me? Here's the error mess ...

Is there a way for me to transfer a variable to a URL?

I'm attempting to send an email that includes a link with a value obtained from Firebase. While I can successfully retrieve the value, I am unsure how to add it to the existing link. Here is my code snippet: sendinvite() { var user = firebase.a ...

Steps for incorporating a filter feature in an Angular Material table

.HTML: Can someone assist me with implementing a filter in this component? I tried using it with the expansion table, but unfortunately, the filter is not working as expected. <mat-dialog-content style="width: 63rem; overflow: initial;"&g ...

NextJS API Generator for OpenAPI specifications

In my NextJS project, we utilize the /api path to implement our API, with an openapi.yaml file defining the interface. To generate the API client successfully, we run the following command: openapi-generator-cli generate -i data/api/openapi.yaml -o src/api ...

Decorator used in identifying the superclass in Typescript

I am working with an abstract class that looks like this export abstract class Foo { public f1() { } } and I have two classes that extend the base class export class Boo extends Foo { } export class Moo extends Foo { } Recently, I created a custom ...

Encountering a Cypress testing issue linked to webpack. Feeling unsure about the next steps to address it

https://i.sstatic.net/z6bmW.png I encountered an error while attempting to run a test file that I created. The default tests run smoothly, but the error only occurs with the file I created. import {cypress as cy} from "cypress" describe('T ...

Encountering an error with errno -100, code 'EPROTO', and syscall 'write' while trying to access localhost:3000 in my frontend repository

It's been a while since I last worked on this repository, and from what I remember, it was running smoothly before it went dormant for almost a year. I'm concerned that the SSL certificate may have expired or needs an update causing issues. I att ...

Require assistance with Dhtmlx and Wijmo grid context menus, as well as touch events, specifically when utilized on an iPhone's Safari browser

I recently created a web application utilizing DHTMLX 5.0 and Wijmo grid. Everything functions smoothly when accessed on Chrome for Android, including the context menu which is opened with a touch-'press and hold' gesture. However, I have encount ...

Angular messaging service error TS2769: There is no overload that fits this call

Currently, I am attempting to utilize a messenger service to send products to the cart component. Within the 'Product' class, there are various product attributes stored. Although I managed to successfully log the product to the console in the ca ...

What is the recommended way to retrieve the Nuxt `$config` within Vuex state? Can it only be accessed through store action methods?

After using the dotenv library for my .env file, I had to change the runtimeConfig in order to secure my project's secret key. In my most recent project, I utilized nuxt version "^2.14" in SPA mode, so I only utilized "publicRuntimeConfig" in my nuxt ...

What is the process of creating an asynchronous function that will resolve a promise when the readline on('close') event is triggered within it in Typescript?

Here's a code snippet I'm working with: private readFile() { var innerPackageMap = new Map<string, DescriptorModel>(); // Start reading file. let rl = readline.createInterface({ input: fs.createReadStream(MY_INPUT_FILE ...

The Ghostly Glare of Doom: Ionic 2 Strikes on Android

While my application runs smoothly in the browser, I encounter an error when trying to run it on my device. The issue is as follows: 0 758771 log deviceready has not fired after 5 seconds. 1 758797 log Channel not fired: onDOMConte ...

A guide on efficiently storing and retrieving a webpage containing two angular2 components using local storage

I've been attempting to store and retrieve a page containing two angular2 components from local storage using the following code, but the component CSS is not being applied. Here is the code I'm using to save: localStorage.setItem('pageCon ...

How can I retrieve a certain type of object property in TypeScript?

Imagine having a collection of flags stored in an object like the example below: type Flags = { flag1: string, flag2: string, flag3: boolean, flag4: number } // const myFlags: Flags = { // flag1: 'value 1', // flag2: 'value 1&ap ...