The "path" parameter must be a string data type in order to proceed. The value received is currently undefined

My current project is utilizing Angular 8

When I attempt to run 'ng build --prod', my project encounters errors.

ERROR in The "path" argument must be of type string. Received type undefined

The issue arose after adding "enableIvy": true to the tsconfig.app.json file

  "angularCompilerOptions": {
    "enableIvy": true
    ...
  }

This adjustment caused an error, seen here: https://i.sstatic.net/f5ztY.png

After investigating, it became clear that the error was originating from a custom Angular library I had created. Upon deleting the library, the error disappeared and my project compiled successfully.

Here is an example of importing the library:

Check out the source code for my library here:

import { SmartUiSharedLibsModule } from 'smart-ui-shared-libs';

Prior to this issue, my project never encountered any errors during builds.

The main reason for these errors is my desire to use Ivy rendering capability.

I am currently working on resolving this problem by adjusting the path as follows:

import { SmartUiSharedLibsModule } from 'smart-ui-shared-libs/lib/smart-ui-shared-libs.module';

By making this change, my project now compiles successfully.

It seems that certain paths within my library were affected when enabling Ivy:

import { ... } from 'smart-ui-shared-libs';

However, changing the import path to include '/lib/smart-ui-shared-libs.module' resolved the issue:

import { ... } from 'smart-ui-shared-libs/lib/smart-ui-shared-libs.module';

Previously, without enabling "enableIvy", the original path still functioned properly for my library.

Answer №1

Don't forget to include "baseUrl": "." in your tsconfig file for the "paths" to function properly.

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

Tips for implementing filters in Angular2 without using the package field in the console

I am currently experiencing an issue with a filter field in my code. The filter works fine when all the package data is present, however, some items do not have a package field. As a result, I need to filter based on the package name but I am encountering ...

Capturing Angular 4 Screenshots with html2canvas

Is there a way to capture and send a screenshot using html2canvas in Angular 4 via an HTTP POST request? Component import { Component, OnInit, NgZone } from '@angular/core'; import { Router, ActivatedRoute, Params } from '@angular/rout ...

Getting News API and showcasing the information in Vuetify.js card components: A step-by-step guide

I'm trying to develop a news website by utilizing the News API for news data. I obtained an API Key from the official News API website, but my code is encountering some issues. The error message reads: TypeError: response.data.map is not a function ...

When converting a .ts file to a .js file using the webpack command, lengthy comments are automatically appended at the end of

As a backend developer, I recently delved into UI technologies and experimented with converting TypeScript files (.ts) to JavaScript files (.js) using the webpack command. While the conversion works well, the generated .js file includes lengthy comments at ...

Error: Attempted to call the 'post' method on an undefined object, resulting in an Uncaught TypeError. This occurred within the Ionic 2 framework while executing the Javascript code located

While I attempt to convey my message in English, unfortunately, it is not a language I am fluent in. Currently, I am working on an Ionic 2 project. In this particular scenario, I am trying to make an HTTP request using the POST method while emulating it o ...

Encountering ExpressionChangedAfterItHasBeenCheckedError when using Mat-select with *ngIf

I'm currently working with a mat-form-field that needs to contain either an input or a select element. Oddly enough, when I use an <input> element, the *ngIf directive functions perfectly. However, if I decide to use a <mat-select> as sho ...

Error message: "Property 'item' is not found within type 'P' - The property is inaccessible in the higher order component even though it is included in the props."

I am currently learning about typescript and exploring how to use Higher Order Components (HoCs) with React in a specific scenario. In my case, I am trying to wrap a component with an HoC that checks whether the "item" passed into the "wrapped" component ...

Angular ng2-date-picker: Using an icon click to open the date picker

Is there a way to trigger the ng2-date-picker to open when clicking on the calendar icon? I am currently utilizing this npm package in my Angular project: https://www.npmjs.com/package/ng2-date-picker ...

Tips for importing font files from the node_module directory (specifically otf files)

We cannot seem to retrieve the fonts file from the node module and are encountering this error message. Can't find 'assets/fonts/roman.woff2' in 'C:\Projects\GIT2\newbusinessapp\projects\newbusinessapp\src ...

Why do we often encounter a "SyntaxError: Unexpected token ;" error when a seemingly normal semicolon is present in distribution files?

Currently, I am in the process of developing a newsletter subscription API using node.js and typescript. This project involves my first experience with typeorm and PostgreSQL. Following several tutorials, I configured typeorm and created the entity types a ...

The npm start command is no longer functioning in Angular 5

When attempting to start angular 5 with npm, I encountered an error that reads: TypeError: callbacks[i] is not a function Can anyone shed some light on where this error might be coming from? It seemed to pop up out of the blue and I can't seem to ...

Is it possible for lodash's omit function to return a specific type instead of just a partial type?

Within the following code snippet: import omit from "lodash/fp/omit"; type EnhancerProps = { serializedSvg: string; svgSourceId: string; containerId: string; }; const rest = omit(["serializedSvg", "containerId"])(props); The variable 'rest&a ...

Verify the image aspect ratio using ngModel

Incorporating Angular 5 and Bootstrap, I've crafted a form that enables users to associate an image with a URL. My aim is to constrain this image to adhere to a specific aspect ratio. The smallimagelink input signifies the ngModel I'm utilizing. ...

The ability of Angular 4 ngComponentOutlet to load dynamic components is great, however, there seems to be an issue

Currently, I am faced with the challenge of loading various 'parent' components and injecting route content into these individual parent components by utilizing ng-content in each one. Essentially, the purpose of each parent component is to manag ...

Why won't my Angular 2 *ngIf display until the function finishes?

Here is the code snippet that I am dealing with... // Pug Template .notification-header-area.layout-row.layout-align-center-center( *ngIf="notification.message != null", class="{{notification.color}}" ) // Inside angular component private onNotificationS ...

What is the best way to assign JSON values to my class property?

I've been working on a weather application that showcases the current weather of 5 different cities. By clicking on each city, users can access a detailed view displaying the 5-day forecast for that particular location. Currently, I have defined a we ...

Is there a way to change a .pptx document into a base64 string?

Currently, I am working on a project that involves creating an addin for Office. The challenge I am facing is opening other pptx files from within the addin. After some research, I discovered that I need to use base64 for the PowerPoint.createPresentation( ...

What is the reason for TS expressing dissatisfaction about the use of a type instead of a type entry being provided

Below is a snippet of code for a Vue3 component that takes in an Array of Objects as a prop: <script lang="ts"> interface CorveesI { What: string, Who: string, Debit: number } export default { name: 'Corvees', props: { ...

Angular refreshes outdated DOM element

Within my Angular (v9) application, I have a simple component. The main goal of this component is to display the current date and time when it is first shown, and then after a 2-second delay, enable a button. Here's the code snippet from app.component ...