Build problems are occurring in the EC2 build box, but they do not arise when building locally

I encountered the following error in my EC2 build environment, but I am unable to reproduce it on my local machine:

ERROR in node_modules/rxjs-compat/add/observable/dom/webSocket.d.ts(1,46): error TS2307: Cannot find module 'rxjs/websocket'.

In my local setup, I have tried:

  1. ng build

  2. ng build --configuration=feature

  3. ng build --prod

    dependencies: { ... }

"devDependencies": { "@angular-devkit/build-angular": "0.13.0", "@angular/cli": "^6.2.9", ... } }

I am uncertain about the cause of this issue and how to replicate it locally for better debugging. Please share your insights.

Answer №1

Be sure to distinguish between your dependencies and devDependencies. Dev dependencies are only installed locally for development purposes, while dependencies are included in the production build.

One way to address this issue is by installing rxjs with the --save flag like so: npm install rxjs rxjs-compat --save

Another solution can be found at: https://github.com/stbui/angular-material-app/issues/39

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

Using Typescript to extract and process keys of a certain type from an object

I am dealing with an object type that has keys corresponding to values of various types, including number, string, optional number, and optional string: interface MyObject { mandatoryNumber: number; optionalNumber?: number; mandatoryString: string; ...

Sending data using formData across multiple levels of a model in Angular

I have a model that I need to fill with data and send it to the server : export interface AddAlbumeModel { name: string; gener: string; signer: string; albumeProfile:any; albumPoster:any; tracks:TrackMode ...

What is the best way to invoke a function in a specific child component from its parent component?

It seems that I might have provided too much information, but the main question remains: how can I call a method in the child component from the parent template's click() event. <button(click)='get()'>GET</button> In my case, th ...

There are currently no examples demonstrating how to populate row headers and dynamic columns in the Material table

Currently, I am facing a situation where I need to have rows as headers and dynamic values in columns for a material table. Below is an example: Department Deparment1 Name Jack Vimal Location Chenn ...

What causes TypeScript to convert a string literal union type to a string when it is assigned in an object literal?

I am a big fan of string literal union types in TypeScript. Recently, I encountered a situation where I expected the union type to be preserved. Let me illustrate with a simple example: let foo = false; const bar = foo ? 'foo' : 'bar' ...

The term 'ObjectId' is typically used as a type, but in this context it is being incorrectly used as a value

I've been scouring for an answer without success. As a newcomer to both stackoverflow and typescript, I've encountered an issue while creating a Mongoose Schema. Here's a snippet of my code: import { Schema, ObjectId } from 'mongoose&a ...

Mistakes in combining Angular NgRx actions and union types

After reviewing my code, I have encountered the following issues: In my shared.actions.ts file: import { Action } from '@ngrx/store'; import { Error } from '../error.interface'; export const types = { IS_LOADING: '[SHARED] IS_L ...

Having a problem with Angular 5 npm install due to a peer dependency issue

Our team is facing an issue with our Angular solution that runs smoothly on one machine, but throws errors when the 'npm install' command is executed on another machine... npm install The errors we are encountering are related to missing peer d ...

NG8001: The element 'app-servers' is unrecognized

Oh no! Issue I've tried everything but can't seem to fix it I'm using the same selector but the problem persists It's supposed to show a label, input box, and button. I've tried all suggested solutions but none have worked for ...

Issue: angular2-cookies/core.js file could not be found in my Angular2 ASP.NET Core application

After spending 2 hours searching for the source of my error, I have decided to seek help here. The error message I am encountering is: "angular2-cookies/core.js not found" I have already installed angular2-cookie correctly using npm. Below is the code ...

The pipe operator in Angular is failing to function as intended

I encountered an error while using the replace operator in Angular. Can someone help me identify the issue? Check out this link for more information ...

Angular Error cli command Error: In order to proceed, please provide a command. To see a list of available commands, use '--help'

When I run any command with Angular CLI, I encounter an error. To resolve this issue, I attempted to uninstall and reinstall it by running the following commands: npm uninstall -g @angular/cli npm install -g @angular/cli However, the problem persists an ...

Steps for assigning the TAB key functionality within a text area

Is there a way to capture the TAB key press within a text area, allowing for indentation of text when the user uses it? ...

Adding markers to a map in Angular 2 using ngOnInit after initialization

Embarking on my Angular journey by creating a sample app incorporating GoogleMaps. import { Component, Input, OnInit, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { FormControl } from '@ ...

Using cookies for authentication in Angular 5

Currently, I am in the process of building a website with Angular 5 and Express JS. One issue I am facing is that after a successful login, the access_token cookie is being sent from the server to the client. Although the cookie is successfully set in th ...

What could be causing the ERROR TypeError in an Angular form where "_co.service.formData" is undefined?

My attempt to create a form in Angular 7 has resulted in an error message: ERROR TypeError: "_co.service.formData is undefined" Here is the HTML code for the component: <form (sumbit)="signUp(form)" autocomplete="off" #form="ngForm"> <div clas ...

What is the best approach to breaking down attributes upon import according to the theme?

Hey there! Here's the thing - I have this file called <code>colors.ts:

export const black = '#0C0C0C'; export const blue = '#22618E'; Whenever I need to use a color, I import it like so: import {black} from 'Shared& ...

Allow users to upload .docx and .xlsx file types with an input field of

I'm currently working on a file upload feature that requires checking for allowed file extensions. The two file extensions allowed are .docx and .xlsx. I've noticed that when I try to log the file extension using console.log, it doesn't prin ...

React Material UI Select component is failing to recognize scrolling event

Having some difficulty understanding how to detect a scroll event with a Select component using Material-UI. The Select has MenuProps={...}, and I want to listen for the scroll event inside it. I've tried putting onScroll within MenuProps={...}, but ...

What is the best way to organize a redux state to meet these specific needs?

In managing a complex web application state, it is crucial to keep track of multiple elements such as selected items and display IDs. The application may house several instances of these "States" with only one being active at any given time. For instance, ...