Search code examples
angulartwiliobuild-errortwilio-conversations

Angular - build error, twilio-conversation


I'm facing the below-mentioned issue while generating production build after using @twilio/Conversations.

ERROR in ../node_modules/twilsock/builds/browser.js
Module build failed (from ../node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'flags' of undefined
    at resolveNameHelper (/Users/khushbu.raval/Host-FA/Flamingo/hellohealthy.webui/HelloHealthy/HelloHealthy/HelloHealthy.WebUI/node_modules/typescript/lib/typescript.js:32155:45)
    at resolveName (/Users/khushbu.raval/Host-FA/Flamingo/hellohealthy.webui/HelloHealthy/HelloHealthy/HelloHealthy.WebUI/node_modules/typescript/lib/typescript.js:31829:20)

It is working with ng build but not with ng build --prod

Versions:

  1. Angular: 7.2.2
  2. Node: 12.14.1
  3. @twilio-conversations: 2.1.0

Steps already performed to resolve error but still not working:

  1. Downgrading @twilio/conversations version.
  2. Upgrading angular-cli, typescript version.
  3. Delete & reinstall node-modules.

Solution

  • Solution: I've migrated Angular from version 7 to 8.2.14 to resolve this issue & it worked.

    Now I can generate prod build successfully after using Angular V8.

    Versions Used:

    1. Node: 14.20.0
    2. Angular: 8.2.14
    3. Twilio-conversation: 2.0.1