OpenVidu / openvidu

OpenVidu Platform main repository
https://openvidu.io
Apache License 2.0
1.91k stars 462 forks source link

Using Ivy build gives: Module depends on 'openvidu-browser'. CommonJS or AMD dependencies can cause optimization bailouts. #532

Open ilprima opened 4 years ago

ilprima commented 4 years ago

Hi, I'm having this warning in the console when running ng serve and build:

videoCall.component.ts depends on 'openvidu-browser'. CommonJS or AMD dependencies can cause optimization bailouts.

I'm using openvidu-browser v 2.15.0

Can this bring to optimization problems?

Ionic Info output:

Ionic:

   Ionic CLI                     : 5.4.16
   Ionic Framework               : @ionic/angular 5.3.2
   @angular-devkit/build-angular : 0.1000.6
   @angular-devkit/schematics    : 10.0.6
   @angular/cli                  : 10.0.6
   @ionic/angular-toolkit        : 2.3.3

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : browser 5.0.4
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 8 other plugins)

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.0.0) : 0.2.8

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.0
   NodeJS     : v12.18.3 (/usr/local/bin/node)
   npm        : 6.14.6
   OS         : macOS Catalina
   Xcode      : Xcode 11.6 Build version 11E708
raghuk-botaiml commented 3 years ago

In angular.json make sure that openvidu-browser is added to allowedCommonJsDependencies section. Example below

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "your-project": {
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "allowedCommonJsDependencies": [
              "linkifyjs",
              "openvidu-browser",
              "rxjs"
            ]
          }
        }
      }
    }
  }
}