Error: Unable to access 'split' method of null object

I'm encountering an error in my angular application when trying to access it, which reads as follows:

TypeError: Cannot read properties of null (reading 'split')
    at required (/Users/.../node_modules/requires-port/index.js:13:23)
    at Object.common.setupOutgoing (/Users/.../node_modules/http-proxy/lib/http-proxy/common.js:101:7)
    at Array.stream (/Users/.../node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:127:14)
    at ProxyServer.<anonymous> (/Users/.../node_modules/http-proxy/lib/http-proxy/index.js:81:21)
    at HttpProxyMiddleware.middleware (.../node_modules/http-proxy-middleware/dist/http-proxy-middleware.js:22:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

This issue occurs specifically on Mac OS Catalina. Interestingly, when testing the app on Linux Ubuntu, it runs smoothly without any errors. Here is a snapshot of my current environment:

Angular CLI: 13.3.9
Node: 16.17.1
Package Manager: npm 8.15.0
OS: darwin x64


Angular CLI: 13.3.9
Node: 16.17.1
Package Manager: npm 8.15.0
OS: darwin x64

Angular: 13.2.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.1
@angular-devkit/build-angular   13.3.9
@angular-devkit/core            13.3.9
@angular-devkit/schematics      13.3.9
@angular/cdk                    13.3.9
@angular/cli                    13.3.9
@schematics/angular             13.3.9
rxjs                            7.5.6
typescript                      4.5.5
    

Answer №1

It was mentioned by @Belouccio that the link within 'target' needs to have 'http'

{
  "/api/*": {
    "target": "https://{{link}}",
    ...

  }
}

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

Attempting to deploy an Angular 9 web project within Visual Studio

Starting my first Angular project has been a smooth process so far. After successfully running "npm start" without any errors, I encountered some issues when launching the application from Visual Studio. Despite sending the same commands, I consistently ...

Executing a function in a child component when a change event occurs on a select element within the parent component

Is it possible to call a function in a child component once the (change) event is triggered on a select element in the parent component? ...

Implementing Immer in Typescript

Recently, I've been exploring the possibility of integrating Immer into my React project that already utilizes Typescript. Unfortunately, I haven't been able to discover a clear guide on how to effectively employ Immer in conjunction with Typescr ...

Encountering "Runtime Compiler Not Loaded" Error in Angular 8

Is there a way to dynamically generate lazy-loaded routes? I've been using the import syntax like this: loadChildren: () => import(`./pages/${module.moduleName}/${module.moduleName}.module`).then(m => m[childModuleName]), and it works with JIT, ...

Encountering a problem with package-lock.json during project deployment

My project publishing attempts keep resulting in the same error showing up repeatedly in the logs: Any thoughts on how this issue can be resolved? 18 error Command failed: git -c core.longpaths=true add D:...\main\backend\package-lock. ...

Getting ahold of a user's Active Directory memberships using @azure/msal-angular

I've implemented @azure/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="28455b49440549464f5d44495a68180619061c">[email protected]</a> (Microsoft Authentication Library for Angular) to set up AAD authentication ...

Issue with TypeORM findOne method causing unexpected output

I am encountering an issue with my User Entity's Email Column when using TypeORM's findOne function. Instead of returning null for a non-existent email, it is returning the first entry in the User Entity. This behavior does not align with the doc ...

The 'value' attribute cannot be connected to 'p-galleria' because it is not recognized as a valid property

I seem to be encountering a unique problem that I can't seem to locate anywhere else. My issue lies with trying to implement Galleria from PrimeNG, as I am struggling to grasp the basics. It's worth noting that I have successfully incorporated nu ...

When Ionic Angular app's IonContent scroll element returns an incorrect scrollTop value after navigation completes, what might be the reason behind this unexpected behavior?

In my quest to scroll the ion-content component to the top upon navigating to the page from certain selected pages, I have implemented a solution using the router's NavigationEnd events. However, I have encountered an issue where the IonContent's ...

The issue of Angular, ng-ckeditor, and the problematic editor-destroy-iframe bug

This particular post pertains to [email protected] and is filled with information on [email protected]. Despite finding similar questions on SO, I am convinced that this remains an unresolved issue. Please refrain from marking this post as a dup ...

Requiring Additional d3 Plugins in d3 v4 Extension: A guide

I am currently working on developing a d3 v4 plugin by following the guidelines provided at . My main objective is to be able to npm install the plugin and seamlessly use it within an Angular 2/4 component. The repository for my project can be found here: ...

Unexpectedly, the current value is not displayed in the Angular2 dropdown select element that contains multiple group options

Within my Angular2 application, I have a dropdown element with 3 different option groups. Here is how it's structured: <select formControlName="reasonCode" id="reasonCode" class="form-control"> <option value="" [ngValue]="null">< ...

Store a video file on your device's memory

Currently, I am storing simple strings in local storage. However, I am now facing the issue of wanting to save videos and images to local storage. Due to the limitations of localStorage supporting only strings, I am unsure of how to achieve this. If you h ...

The functionality of the Nested Child Route Module seems to be failing in Angular 9

Below is my setup for nested routes: home -- about -- test Clicking on host/about works fine. However, navigating to host/about/test is causing a redirect to "/" instead of displaying the desired content. You can find the code sni ...

Anticipate that the typescript tsc will generate an error, yet no error was encountered

While working in the IDE to edit the TypeScript code, an issue was noticed in checkApp.ts with the following warning: Argument type { someWrongParams: any } is not assignable to parameter type AddAppToListParams. Surprisingly, when running tsc, no error ...

Is it possible in Angular Typescript to map the attributes of an array to a class object or generate a new object using the elements of the array?

Here are the specifications of the tools I am currently using: Angular CLI: 10.0.6 Node: 12.18.2 Operating System: win32 x6 Angular Version: 10.0.10 My goal is to retrieve selected rows from ag-grid using a specific method. When I retrieve the row, i ...

What could be causing my loader to malfunction when using the fxLayout row wrap?

In one of my components, I have a fxLayout div with row wrap and *ngFor to display an array of material cards. Recently, I implemented a full-page loader in the component, but it seems to be affecting the responsiveness of the fxLayout. Now, the layout onl ...

Finding the topOffset in Angular by targeting a class called 'dropdown'

I am trying to achieve the same result in Angular as I do with jQuery/HTML. When using jQuery, the topOffset value remains the same whether I scroll or not. // get the top offset of the dropdown (distance from top of the page) var topOffset = $(".drop ...

What is the best way to utilize an "as" property in TypeScript when forwarding props to a component?

I am currently working on creating a collection of components, and I require some of them to have the option of a customizable tag name. For instance, there are times when what seems like a <button> is actually an <a>. Therefore, I would like t ...

How can I modify the body background or background-color when navigating routes in Angular 4?

Is there a way to update the body background or background-color when changing routes in Angular 4? ...