Encountered a bug in Angular 10 npm: "hasBindingPropertyName is not a function

Out of the blue, I encountered this error during a Jenkins build. I attempted to resolve it by upgrading Angular to version 10.1, but unfortunately, the issue persisted. Subsequently, I reverted back to Angular 10.0. Below are the dependencies listed in package.json:

[09/11/2020 03:26:56.420] - Build:: Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015 [09/11/2020 03:27:09.120] - Build:: Error: Error on worker #5: TypeError: dir[ioType].hasBindingPropertyName is not a function [09/11/2020 03:27:09.120] - Build:: at Project_folder/node_modules/@angular/compiler/bundles/compiler.umd.js:30061:79 [09/11/2020 03:27:09.120] - Build:: at Array.find () [09/11/2020 03:27:09.120] - Build:: at setAttributeBinding

Package.json

"dependencies": {
    "@angular-devkit/build-angular": "0.1000.4",
    "@angular/animations": "^10.0.7",
    "@angular/common": "^10.0.7",
    "@angular/compiler": "^10.0.7",
    "@angular/core": "^10.0.7",
    "@angular/forms": "^10.0.7",
    "@angular/platform-browser": "^10.0.7",
    "@angular/platform-browser-dynamic": "^10.0.7",
    "@angular/router": "^10.0.7",
    "@ng-idle/core": "^8.0.0-beta.4",
    ...
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular/cli": "^10.0.4",
    ...
    "webpack-node-externals": "^1.7.2"
  }

Answer №1

There appears to be a bug in the @angular/compiler 10.1.1 version.

Although this isn't a permanent solution, I managed to work around the issue by downgrading both @angular/compiler and @angular/compile-cli to 10.0. Simply updating the package.json file wasn't enough; I also had to clean up the node_modules directory to revert back the code.

Here are the steps I took to successfully build...

  1. Update package.json
 "dependencies": {
    ...
    "@angular/compiler": "~10.0.3",
    ...
  },
  "devDependencies": {
    ...
    "@angular/compiler-cli": "~10.0.3",
    ...
  }

Make sure to use the tilde (~) instead of caret (^) like above to prevent npm from automatically updating to version 10.1.1.

  1. rm -rf node_modules

  2. npm update && ng build --prod

Answer №2

One possible reason for this issue is an incorrect number of closing tags in the HTML code. Make sure to review and verify any recent changes made to the HTML template file.

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

Execute multiple JavaScript files dynamically by utilizing the same npm run command

My directory structure: app Model user.js post.js Contents of my package.json file: "scripts": { "migrate": "node ./app/Model/" } I am looking to execute JavaScript files via command line in a dynamic manner. For example: npm run migr ...

Files for production may vary when using npm, gulp, and Node.js

I have a task runner script that combines and compresses my JavaScript files. Using the gulp-html-replace plugin, I can swap out all individual JS files with the concatenated one in my index.html. This results in a development version (/dev/index.html) w ...

GlobalsService is encountering an issue resolving all parameters: (?)

I am currently working on implementing a service to store globally used information. Initially, the stored data will only include details of the current user. import {Injectable} from '@angular/core'; import {UserService} from "../user/user.serv ...

Error TS2304: Unable to locate identifier 'QRScanner'

I am currently exploring https://www.npmjs.com/package/cordova-plugin-qrscanner in order to implement a QR scanning feature in my mobile application. As part of the initial steps, I have written the following code snippet in my typescript file: function o ...

Discover outdated npm packages

Over the past two years, I've come across numerous npm packages that were once popular and active but have since been retired or left unmaintained. This realization typically only hits me when I encounter broken functionality. Is there a tool availab ...

What is the best way to ensure my npm package on GitHub is up to

Is there a way to update npm packages on GitHub when the version dependencies are outdated? I do not own these packages, but my platform relies on them. When I update my Node.js version to the latest one, I encounter errors. Below are the commands I have ...

Utilizing electron as a development dependency in an Ubuntu environment

After installing electron on Ubuntu 17.10, this is the process I followed: ole@mki:~/angular-electron$ npm i --save-dev electron > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d9bcb5bcbaadabb6b799e8f7eef7e8eb"> ...

What alternatives are available to eliminate the need for body-parser?

After successfully installing the express module and body-parser, I realized that I can now utilize express to gather all necessary information from the user without the need for body-parser. How can I safely remove body-parser from my configuration? cli ...

What to do when nodeenv does not link grunt after being installed using npm install -g?

When using nodeenv, I am facing an issue where binaries are not getting linked for npm installed modules. $ mkvirtualenv venv (venv)$ pip install nodeenv (venv)$ nodeenv -p (venv)$ deactivate $ workon venv (venv)$ which grunt /usr/local/bin/grunt (venv)$ ...

Entrypoint Docker Script catering to the execution of either npm config, npm run, or both commands

When conducting tests with TestCafe and CucumberJS using Docker, which is built on top of Node.js, the test runs are initiated via npm scripts. The workflow includes... 1) Pulling a pre-built Docker image from Git 2) Optionally setting a 'config&apo ...

Error encountered while setting up dependencies on VPS due to SQLite problem

I am currently in the process of hosting a Discord bot developed in TypeScript on my VPS provided by galaxygate, running Ubuntu 20.04. Fortunately, Git was already installed on the server, so I cloned and pulled my project from GitHub. Next, I attempted t ...

What are the steps to eliminate the package-lock.json warning while constructing a Node application image using Docker?

Exploring Docker to develop a compact Node.js application image, I aim to eliminate the warning provided below: npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN <a href="/cdn-cgi/l/email-protection" class="__cf_ ...

Error: The gulp-cssmin plugin encountered a TypeError because it attempted to read the property '0' of a null

I am attempting to condense my code, but I am encountering this error: D:\gulp-compiler\node_modules\gulp-cssmin\node_modules\clean-css\lib\selectors\extractor.js:66 return name.replace(/^\-\w+\-/, ...

The speed of npm installation leaves much to be desired

This is the content of my package.json file: { "name": "trainologic", "version": "1.0.0", "description": "", "main": "main.js", "dependencies": { "child_process": "^1.0.2", "http-server": "^0.9.0", "open": "0.0.5" }, "devDepende ...

Make sure npm installs identical dependencies across different machines

My current issue involves a packages.json file where I'm installing node modules using npm install from the same directory. However, the problem arises when different machines already have some dependencies installed globally. Although this situation ...

Running NPM install encounters difficulty when trying to access a private repository

npm login. I fill in my username, password, and email then successfully log in. I make a change to a package. After running npm publish, the (org) package is published, and I can view it on the NPM website when logged in. 5. However, attempting to install ...

Is there a way to prevent npm from bootstrapping when pushing to Heroku using git?

I've been developing a Facebook Messenger bot and hosting it on Heroku. In the package.json file, I have specified my node and NPM versions like this: "engines": { "node": "8.10.0", "npm": "5.7.1" }, Whenever I push changes to Heroku using ...

Duplicate nodes_modules packages detected

Currently, I am utilizing npm to install numerous packages for my application. As a result, I have a node_modules directory that contains all the packages. However, some of these packages contain their own node_modules directories which in turn may contai ...

Encountered an error while attempting to compile node-sass with Yarn

Currently, I am facing an issue while trying to fix the installation of a foundation site using yarn as recommended by foundation-cli. The yarn error log shows that two attempts failed even after deleting `yarn.lock` and running `npm install -g node-sass`. ...

Automatically compile files while performing an npm install or update

I am looking for a way to automatically compile my TypeScript code into JavaScript when another project requires it. For example, when a project runs npm install or updates with my project as a dependency, I want a specific command to be executed after all ...