Skip to content Skip to sidebar Skip to footer

Cannot Read Property 'bind' Of Undefined In Angular 8 Custom Web Component

I am building a custom web component using angular 8. I have noticed that Angular 8 doesn't have --single-build true, so i used the following code (async function build() { con

Solution 1:

The following link Cannot read property 'bind' of undefined helped me a lot. To add jsonpFunction: "o3iv79tz90732goag" in angular 8 had to npm i @angular-builders/custom-webpack and create a webpack config file see below: see documentation for @angular-builders/custom-webpack

constwebpack= require('webpack');

module.exports = {
  output: {
    jsonpFunction: 'wpJsonpBundle'
  }
};

Then add the custom webpack config file to angular.json

"architect": {
        "build": {
          "builder": "@angular-builders/custom-webpack:browser",
          "options": {
            "customWebpackConfig": {
              "path": "./webpack.config.js"
            },
           ....

After ng build, i then concatenate the files using the function in the question and can use the custom element in other angular projects.

Post a Comment for "Cannot Read Property 'bind' Of Undefined In Angular 8 Custom Web Component"