Receiving 'Module not found' error in Typings on specific machines within the same project. Any suggestions on how to troubleshoot this issue?

I have a project cloned on two separate machines, each running VS2015 with Typings 1.8.6 installed. One machine is running the Enterprise version while the other has the Professional version, although I don't think that should make a difference.

Interestingly, on the first machine, I am getting full intellisense support even without any triple slash references in individual files. It seems to pick up the triple slash file from a single file called refs.d.ts in the scripts folder, similar to a _references.js file.

However, on the second machine, all external imports are throwing a 'Cannot find module ...' error. This issue does not affect internal imports from other project files.

For example, this line fails:

import {Component} from 'angular2/core'

But this line works:

import {AppComponent} from './app.component';

It seems like the working machine has some sort of global or environment settings that the second machine is missing. Despite my efforts over the last few days, I haven't been able to resolve this issue. Any help would be greatly appreciated.

Here's what I've tried on the second machine:

Adding triple slash references in individual .ts files

///<reference path="../../node_modules/angular2/typings/browser.d.ts" />

Modifying tsconfig.js:

  • Removing node_modules from the exclude list
  • Explicitly referencing the angular2 type definition file in the files array
  • Setting ModuleResolution to 'Node'

Reinstalling typings in Visual Studio.

Answer №1

At last!

Just made the leap from VS2017 to VS2018.

The computer that was previously using VS2017 Update 1 is now on Update 2.

This issue had been causing me frustration for days. Hopefully, this solution helps someone else avoid the same headache!

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

Issue with AWS SDK client-S3 upload: Chrome freezes after reaching 8 GB upload limit

Whenever I try to upload a 17 GB file from my browser, Chrome crashes after reaching 8 GB due to memory exhaustion. import { PutObjectCommandInput, S3Client } from '@aws-sdk/client-s3'; import { Progress, Upload } from "@aws-sdk/lib-storage& ...

Managing animations with multiple components in Angular 2+

I am currently developing an Angular application that will utilize a series of Modals in a wizard-style setup. For this project, I am utilizing the Angular-cli tool. Below is the code snippet showing how I have set up my animations: animations:[ t ...

The custom form input in Angular2 is throwing an error because it is trying to access the property 'name' of an

Upon switching to the latest Angular version 2 final, I encountered the following error Uncaught TypeError: Cannot read property 'name' of undefined This is my customized input import { Component, EventEmitter, Provider, forwardRef } from &a ...

Angular frontend failing to send authorization cookie for cross-origin requests, despite using withCredentials

Today, I've been facing a persistent issue that I just can't seem to figure out. I have my Angular frontend running on localhost:4200 and a Spring Boot backend on localhost:8080. When I call the localhost:8080/api/login endpoint from my Angular ...

Encountering an "Invalid parameter: redirect_uri" error in Keycloak while manually refreshing the page

This is an Angular 17 single-page application utilizing the latest version of keycloak-angular (15.2.1 at the time of writing). I'm facing a perplexing issue where after successfully authenticating and logging out, if I reload the page, it breaks enti ...

Trouble arises when default route in Angular uses '' and '**' for 404 errors as intended

Within my app-routing.module file, I have set up child routes along with an empty route for the default login page and a '**' route for handling 404 errors. Below is the code snippet: const routes: Routes = [ { path: 'dashboard' ...

What is the best method for transforming an object into an interface without prior knowledge of the keys

I am looking for a solution to convert a JSON into a TypeScript object. Here is an example of the JSON data: { "key1": { "a": "b" }, "key2": { "a": "c" } } The keys key1 and key2 a ...

Using JSON objects as values in Angular2

When displaying a select option in my HTML, I am currently able to show a string as the value. However, I would like to have the entire JSON object as the value instead of just the string that is being displayed. Here is my code: <select *ngIf="car" c ...

Exploring Vue with Typescript - leveraging components without explicit definitions

Has anyone successfully used vue-instant component as a child component before? I'm having trouble adding components without definition. Could it be related to webpack config ignoring node_modules due to lack of type declaration? Here's the code ...

Updating a data attribute in Angular 2: A different approach

Currently, I am utilizing ConvertFlow to integrate pre-designed form templates into my project. To specify where the form should appear, I include a div with the unique identifier of the form created within their platform. While this process is straightfor ...

Angular BehaviorSubject is failing to emit the next value

I am facing an issue with a service that uses a Behavior subject which is not triggering the next() function. Upon checking, I can see that the method is being called as the response is logged in the console. errorSubject = new BehaviorSubject<any> ...

How to dynamically assign a value in a React datepicker component in a React application

Having troubles with react-datepicker? I encountered an issue where setting the value of react-datepicker from props caused it to either not show the value or display a 'wrong time format' error. Here is a snippet of the Datepicker code: this.sta ...

Encountering a "404 not found" error when trying to update private packages with ng update

I am in the process of updating my Angular app from version 13 to 14, which involves a private package called company-package hosted at company.com/.... Unfortunately, this package is not scoped and does not start with an @... My npm version is currently ...

Exploring the world of shaders through the lens of Typescript and React three fiber

Looking to implement shaders in React-three-fiber using Typescript. Shader file: import { ShaderMaterial } from "three" import { extend } from "react-three-fiber" class CustomMaterial extends ShaderMaterial { constructor() { supe ...

Oops! Issue encountered while trying to read the file "src/core/database/config.ts"

Need help with migrating a database in a Node Nest.JS application. When running the npx sequelize-cli db:migrate shell command, I encountered the following exception: Error details: Error: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".t ...

The ngFor directive is malfunctioning when attempting to iterate over an array

Take a look at my code below: import { Component } from '@angular/core'; import { ProjectService } from '../../services/project'; import { Project } from '../../models/project'; @Component({ selector: 'projects-comp ...

The Type '{Property: string, Property2: string} does not match the type Observable<Filters[]>

Here is a method I am trying to use: getFilters(): Observable<Filters[]> { let filters: Observable<Filters[]> = [ { property: "Value", property2: "Value2" }, { property: "Value3", property2: "V ...

The health check URL is experiencing issues: Unable to locate any routes

I am currently developing a .net Core 2.2/Angular 8 application and recently came across the HealthCheck feature. I decided to incorporate it into my application, so here is a snippet from my Startup.cs file: using HealthChecks.UI.Client; using Mi ...

Incorporating the Angular "dist" build file into the Node.js server.js script

Having some trouble deploying my MEAN stack app on Heroku. Managed to commit the app, but struggling to connect the ng build "dist" file to my server.js file. This is the snippet from my server.js file where I'm attempting to link the file: var dist ...

Connect data dynamically to the p-table based on columns

I'm facing a challenge in displaying JSON data in a table format, and I'm looking for a way to accomplish this using p-table. When looping through the data, I'm noticing duplicate records in the rows. Can anyone guide me on how to achieve th ...